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>
Tue, 18 Mar 2014 17:06:17 +0000 (18:06 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h263dec.c

index e231b08..df2d7d3 100644 (file)
@@ -721,10 +721,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);