mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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>
This commit is contained in:
parent
0bad50522d
commit
21b25537fb
@ -2653,10 +2653,9 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (startcode_found) {
|
if (startcode_found) {
|
||||||
av_fast_malloc(&s->bitstream_buffer,
|
av_fast_padded_malloc(&s->bitstream_buffer,
|
||||||
&s->allocated_bitstream_buffer_size,
|
&s->allocated_bitstream_buffer_size,
|
||||||
buf_size - current_pos +
|
buf_size - current_pos);
|
||||||
FF_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
if (!s->bitstream_buffer)
|
if (!s->bitstream_buffer)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
memcpy(s->bitstream_buffer, buf + current_pos,
|
memcpy(s->bitstream_buffer, buf + current_pos,
|
||||||
|
Loading…
Reference in New Issue
Block a user