mirror of https://git.ffmpeg.org/ffmpeg.git
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,10 +1045,13 @@ 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);
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue