[FFmpeg-devel] [PATCH 1/3] lavf/mpjpeg: Trim quotes on MIME boundary, if present.

Alexander Agranovsky alex at sighthound.com
Sun Feb 14 05:47:20 CET 2016


-------------- next part --------------
From f2d8bc033cc6ab6e9a42472c99bdfce8305a13db Mon Sep 17 00:00:00 2001
From: Alex Agranovsky <alex at sighthound.com>
Date: Fri, 12 Feb 2016 12:59:29 -0500
Subject: [PATCH 1/3] lavf/mpjpeg: Trim quotes on MIME boundary, if present.

Fixes 5023

Signed-off-by: Alex Agranovsky <alex at sighthound.com>
---
 libavformat/mpjpegdec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index c9fcf47..3446f2a 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -277,6 +277,13 @@ static char* mpjpeg_get_boundary(AVIOContext* pb)
                 len = end - start - 1;
             else
                 len = strlen(start);
+
+            /* some endpoints may enclose the boundary
+              in Content-Type in quotes */
+            if ( len>2 && *start == '"' && start[len-1] == '"' ) {
+                start++;
+                len -= 2;
+            }
             res = av_strndup(start, len);
             break;
         }
-- 
2.5.4 (Apple Git-61)



More information about the ffmpeg-devel mailing list