mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 18:32:22 +00:00
mpjpegde: trim header name/value of MIME headers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0572bd1a62
commit
1de21215d4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user