[FFmpeg-cvslog] img2dec: check return value of av_new_packet()

Paul B Mahol git at videolan.org
Mon Oct 15 17:14:49 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Oct 15 14:53:56 2012 +0000| [3f8148911c6e6e1f2a042bd4ca3ad8516a92130c] | committer: Paul B Mahol

img2dec: check return value of av_new_packet()

Fixes CID703626.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f8148911c6e6e1f2a042bd4ca3ad8516a92130c
---

 libavformat/img2dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 79f10b9..c493f1a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -375,7 +375,8 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
         size[0]= 4096;
     }
 
-    av_new_packet(pkt, size[0] + size[1] + size[2]);
+    if (av_new_packet(pkt, size[0] + size[1] + size[2]) < 0)
+        return AVERROR(ENOMEM);
     pkt->stream_index = 0;
     pkt->flags |= AV_PKT_FLAG_KEY;
 



More information about the ffmpeg-cvslog mailing list