avcodec/h263dec: Fix use of uninitialized memory from the bitstream buffer
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Mar 2014 17:06:17 +0000 (18:06 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 21 Apr 2014 22:21:27 +0000 (00:21 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f07cebcd910c97ff6012085c21493231752990e9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h263dec.c

index a0cb82c..8809e8e 100644 (file)
@@ -720,10 +720,10 @@ frame_end:
         }
 
         if(startcode_found){
-            av_fast_malloc(
+            av_fast_padded_mallocz(
                 &s->bitstream_buffer,
                 &s->allocated_bitstream_buffer_size,
-                buf_size - current_pos + FF_INPUT_BUFFER_PADDING_SIZE);
+                buf_size - current_pos);
             if (!s->bitstream_buffer)
                 return AVERROR(ENOMEM);
             memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);