1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/avpacket: check for malloc failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
wm4 2014-12-12 18:15:42 +01:00 committed by Michael Niedermayer
parent 9f85c273a3
commit ce35a61399

View File

@ -546,8 +546,11 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src)
if (ret < 0)
goto fail;
memcpy(dst->buf->data, src->data, src->size);
} else
} else {
dst->buf = av_buffer_ref(src->buf);
if (!dst->buf)
goto fail;
}
dst->size = src->size;
dst->data = dst->buf->data;