mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +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…
x
Reference in New Issue
Block a user