diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-07 01:27:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-07 01:29:38 +0100 |
commit | 21b25537fb8f77b098575e90d8b24556451badf3 (patch) | |
tree | 3c6e4dcc6433828b0173a7ad06480ef29ec4273e /libavcodec | |
parent | 0bad50522d34a16c0ce90a74b103ff768413148b (diff) | |
download | ffmpeg-21b25537fb8f77b098575e90d8b24556451badf3.tar.gz |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg4videodec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 34ec2b3e61..1771e71d06 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -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, |