lavf/mpjpeg: Trim quotes on MIME boundary, if present.
authorAlex Agranovsky <alex@sighthound.com>
Fri, 12 Feb 2016 17:59:29 +0000 (12:59 -0500)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 14 Feb 2016 11:31:08 +0000 (12:31 +0100)
Fixes 5023

Signed-off-by: Alex Agranovsky <alex@sighthound.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mpjpegdec.c

index c9fcf47..3446f2a 100644 (file)
@@ -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;
         }