[FFmpeg-devel] [PATCH] lavf/mpjpegdec: Fixed dereference after null check

Alexander Agranovsky alex at sighthound.com
Wed Dec 9 18:55:14 CET 2015


-------------- next part --------------
From 36596b444e584eb7ccceb24c838f0273116691f8 Mon Sep 17 00:00:00 2001
From: Alex Agranovsky <alex at sighthound.com>
Date: Wed, 9 Dec 2015 12:48:20 -0500
Subject: [PATCH] lavf/mpjpegdec: Fixed dereference after null check

Fixes Coverity CID 1341576
---
 libavformat/mpjpegdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 3429d19..dd31f87 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -260,8 +260,10 @@ static char* mpjpeg_get_boundary(AVIOContext* pb)
     start = mime_type;
     while (start != NULL && *start != '\0') {
         start = strchr(start, ';');
-        if (start)
-            start = start+1;
+        if (!start)
+            break;
+
+        start = start+1;
 
         while (av_isspace(*start))
             start++;
-- 
2.4.9 (Apple Git-60)



More information about the ffmpeg-devel mailing list