git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0572bd1
)
mpjpegde: trim header name/value of MIME headers
author
Alex Agranovsky
<alex@sighthound.com>
Sat, 12 Sep 2015 23:07:53 +0000
(19:07 -0400)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Mon, 14 Sep 2015 15:13:14 +0000
(17:13 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mpjpegdec.c
patch
|
blob
|
history
diff --git
a/libavformat/mpjpegdec.c
b/libavformat/mpjpegdec.c
index
8c93c0f
..
4ce90ce
100644
(file)
--- 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;
@@
-51,6
+64,7
@@
static int split_tag_value(char **tag, char **value, char *line)
*p = '\0';
*tag = line;
+ trim_right(*tag);
p++;
@@
-58,6
+72,7
@@
static int split_tag_value(char **tag, char **value, char *line)
p++;
*value = p;
+ trim_right(*value);
return 0;
}