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,11 +1045,14 @@ do {\
|
||||||
|
|
||||||
if (s1->bitstream_buffer) {
|
if (s1->bitstream_buffer) {
|
||||||
if (s1->bitstream_buffer_size +
|
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,
|
av_fast_malloc(&s->bitstream_buffer,
|
||||||
&s->allocated_bitstream_buffer_size,
|
&s->allocated_bitstream_buffer_size,
|
||||||
s1->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,
|
memcpy(s->bitstream_buffer, s1->bitstream_buffer,
|
||||||
s1->bitstream_buffer_size);
|
s1->bitstream_buffer_size);
|
||||||
memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
|
memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
|
||||||
|
|
Loading…
Reference in New Issue