avcodec/vqavideo: use av_mallocz() for decode_buffer()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 1 Jan 2014 14:29:20 +0000 (15:29 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 1 Jan 2014 14:35:34 +0000 (15:35 +0100)
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f62eaba897d_595_4D6EFA92.VQA
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vqavideo.c

index 9133855..c34849d 100644 (file)
@@ -179,7 +179,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
     /* allocate decode buffer */
     s->decode_buffer_size = (s->width / s->vector_width) *
         (s->height / s->vector_height) * 2;
-    s->decode_buffer = av_malloc(s->decode_buffer_size);
+    s->decode_buffer = av_mallocz(s->decode_buffer_size);
     if (!s->decode_buffer)
         goto fail;