OSDN Git Service

avcodec/shorten: clear bitstream buffer
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 17:09:58 +0000 (18:09 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 26 Dec 2013 00:35:00 +0000 (01:35 +0100)
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3ca95606fb_6393_luckynight-partial.shn
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/shorten.c

index 2bd35d2..8b91ed3 100644 (file)
@@ -432,6 +432,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
             av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
             return AVERROR(ENOMEM);
         }
+        memset(tmp_ptr, 0, s->allocated_bitstream_size);
         s->bitstream = tmp_ptr;
     }