[FFmpeg-devel] [PATCH] mpjpeg: trim header name/value of MIME headers while probing
Alex Agranovsky
alex at sighthound.com
Sat Sep 12 23:10:06 CEST 2015
libavformat/mpjpegdec.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 1661b9d..009bbaf 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -40,6 +40,19 @@ static int get_line(AVIOContext *pb, char *line, int line_size)
return 0;
}
+
+static void trim_right(char* p)
+{
+ char* end;
+ if (!p || !*p)
+ return;
+ end=p+strlen(p)-1;
+ while (end!=p && av_isspace(*end)) {
+ *end='\0';
+ end--;
+ }
+}
+
static int split_tag_value(char **tag, char **value, char *line)
{
char *p = line;
@@ -60,6 +73,7 @@ static int split_tag_value(char **tag, char **value, char *line)
*p = '\0';
*tag = line;
+ trim_right(*tag);
p++;
@@ -67,6 +81,7 @@ static int split_tag_value(char **tag, char **value, char *line)
p++;
*value = p;
+ trim_right(*value);
return 0;
}
--
Alex Agranovsky
Sighthound, Inc
www.sighthound.com
More information about the ffmpeg-devel
mailing list