Browse Source

avcodec/mpeg4videodec: use av_fast_padded_malloc() for bitstream buffer

Fixes use of uninitialized memory with vlc (sample from ticket3277)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 11 years ago
parent
commit
21b25537fb
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavcodec/mpeg4videodec.c

+ 2
- 3
libavcodec/mpeg4videodec.c View File

@@ -2653,10 +2653,9 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
}

if (startcode_found) {
av_fast_malloc(&s->bitstream_buffer,
av_fast_padded_malloc(&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,


Loading…
Cancel
Save