diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 20:56:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 20:58:35 +0100 |
commit | ea3eaa37b119f79f64fd6af2c24b81bb9e7dff6f (patch) | |
tree | 35bfbbd9b8b32fab273bc57e5f79c9256a017297 | |
parent | eca2eb2dfa992d394f75be08464295844b5e97e6 (diff) | |
download | ffmpeg-ea3eaa37b119f79f64fd6af2c24b81bb9e7dff6f.tar.gz |
flashsv: only realloc blocks for version 2
Fixes 10l regression introducing a memleak
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/flashsv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 27f5dce1d1..9e13ea6251 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -322,9 +322,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, s->keyframedata = av_realloc(s->keyframedata, avpkt->size); memcpy(s->keyframedata, avpkt->data, avpkt->size); } - s->blocks = av_realloc(s->blocks, - (v_blocks + !!v_part) * (h_blocks + !!h_part) - * sizeof(s->blocks[0])); + if(s->ver == 2) + s->blocks = av_realloc(s->blocks, + (v_blocks + !!v_part) * (h_blocks + !!h_part) + * sizeof(s->blocks[0])); av_dlog(avctx, "image: %dx%d block: %dx%d num: %dx%d part: %dx%d\n", s->image_width, s->image_height, s->block_width, s->block_height, |