diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-02-22 13:37:35 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-02-22 13:37:35 +0000 |
commit | a72b41035cc4925922b4164b7453c9a5c2b7e630 (patch) | |
tree | 15cba205a975cc7edeafd87b26114cb13f9cf8e6 /libavformat/mxg.c | |
parent | db05f7ab1626a175ec1aea2d1d64e2e49b632753 (diff) | |
download | ffmpeg-a72b41035cc4925922b4164b7453c9a5c2b7e630.tar.gz |
mxg: do not leak mxg->buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/mxg.c')
-rw-r--r-- | libavformat/mxg.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mxg.c b/libavformat/mxg.c index d911a33e7f..e9a6f22b20 100644 --- a/libavformat/mxg.c +++ b/libavformat/mxg.c @@ -101,17 +101,19 @@ static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size) MXGContext *mxg = s->priv_data; unsigned int current_pos = mxg->buffer_ptr - mxg->buffer; unsigned int soi_pos; + uint8_t *buffer; int ret; /* reallocate internal buffer */ if (current_pos > current_pos + cache_size) return AVERROR(ENOMEM); soi_pos = mxg->soi_ptr - mxg->buffer; - mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size, - current_pos + cache_size + - FF_INPUT_BUFFER_PADDING_SIZE); - if (!mxg->buffer) + buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size, + current_pos + cache_size + + FF_INPUT_BUFFER_PADDING_SIZE); + if (!buffer) return AVERROR(ENOMEM); + mxg->buffer = buffer; mxg->buffer_ptr = mxg->buffer + current_pos; if (mxg->soi_ptr) mxg->soi_ptr = mxg->buffer + soi_pos; |