diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-12-12 18:15:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-12 19:31:29 +0100 |
commit | ce35a61399cd495fb3d0e8a2f0a18d9d729440e7 (patch) | |
tree | f1dca7891d0694fac975b2806ee9b4865257e327 | |
parent | 9f85c273a36d0db1c6c05759f6bb6eee763ad429 (diff) | |
download | ffmpeg-ce35a61399cd495fb3d0e8a2f0a18d9d729440e7.tar.gz |
lavc/avpacket: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/avpacket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 3c26046dad..186747659d 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -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; |