From 09b8e97ab62d4c83cf892cfdd49e2c28a9a41eba Mon Sep 17 00:00:00 2001 From: Alex Agranovsky Date: Fri, 12 Feb 2016 12:59:29 -0500 Subject: [PATCH] lavf/mpjpeg: Trim quotes on MIME boundary, if present. Fixes 5023 Signed-off-by: Alex Agranovsky Signed-off-by: Michael Niedermayer --- libavformat/mpjpegdec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index c9fcf47f1e..3446f2a4f1 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; }