summaryrefslogtreecommitdiff
path: root/libavcodec/flashsv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-15 16:09:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-15 16:46:42 +0100
commitbc08ca841e66134a3b0d900cf152b4a263fa6545 (patch)
tree735cbc4311a88ea492fcd6a253163a938a081e39 /libavcodec/flashsv.c
parent850e5c041d7e96e23a7ae2b002f244e4e4acda96 (diff)
flashsv: reallocate block array independant of frame type.
Fixes NULL pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flashsv.c')
-rw-r--r--libavcodec/flashsv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 14c514c361..27f5dce1d1 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -321,10 +321,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
if (s->is_keyframe) {
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]));
}
+ 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,