mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-07 16:40:10 +02:00
avcodec/mpegvideo: Check pointer when allocation fail
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e85d91da48
commit
e5d1152ccc
@ -1045,11 +1045,14 @@ do {\
|
||||
|
||||
if (s1->bitstream_buffer) {
|
||||
if (s1->bitstream_buffer_size +
|
||||
FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size)
|
||||
FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size) {
|
||||
av_fast_malloc(&s->bitstream_buffer,
|
||||
&s->allocated_bitstream_buffer_size,
|
||||
s1->allocated_bitstream_buffer_size);
|
||||
s->bitstream_buffer_size = s1->bitstream_buffer_size;
|
||||
if (!s->bitstream_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
s->bitstream_buffer_size = s1->bitstream_buffer_size;
|
||||
memcpy(s->bitstream_buffer, s1->bitstream_buffer,
|
||||
s1->bitstream_buffer_size);
|
||||
memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
|
||||
|
Loading…
Reference in New Issue
Block a user