[FFmpeg-cvslog] lavc/avpacket: check for malloc failure
wm4
git at videolan.org
Fri Dec 12 19:37:09 CET 2014
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Fri Dec 12 18:15:42 2014 +0100| [ce35a61399cd495fb3d0e8a2f0a18d9d729440e7] | committer: Michael Niedermayer
lavc/avpacket: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce35a61399cd495fb3d0e8a2f0a18d9d729440e7
---
libavcodec/avpacket.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 3c26046..1867476 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;
More information about the ffmpeg-cvslog
mailing list