Browse code

avcodec/shorten: clear bitstream buffer

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>

Michael Niedermayer authored on 2013/12/24 02:09:58
Showing 1 changed files
... ...
@@ -432,6 +432,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
432 432
             av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
433 433
             return AVERROR(ENOMEM);
434 434
         }
435
+        memset(tmp_ptr, 0, s->allocated_bitstream_size);
435 436
         s->bitstream = tmp_ptr;
436 437
     }
437 438