diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 818f8c9..9f41bd1 100644
|
a
|
b
|
eoi_parser:
|
| 2093 | 2093 | if (s->interlaced) { |
| 2094 | 2094 | s->bottom_field ^= 1; |
| 2095 | 2095 | /* if not bottom field, do not output image yet */ |
| | 2096 | #if 0 |
| 2096 | 2097 | if (s->bottom_field == !s->interlace_polarity) |
| 2097 | 2098 | break; |
| | 2099 | #endif |
| 2098 | 2100 | } |
| 2099 | 2101 | if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0) |
| 2100 | 2102 | return ret; |
diff --git a/libavformat/format.c b/libavformat/format.c
index 7df06b7..f4836d7 100644
|
a
|
b
|
int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
|
| 261 | 261 | |
| 262 | 262 | if (pb->av_class) { |
| 263 | 263 | uint8_t *mime_type_opt = NULL; |
| | 264 | char* semi; |
| 264 | 265 | av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type_opt); |
| 265 | 266 | pd.mime_type = (const char *)mime_type_opt; |
| | 267 | semi = strchr(pd.mime_type, ';'); |
| | 268 | if (semi) { |
| | 269 | *semi='\0'; |
| | 270 | } |
| 266 | 271 | } |
| 267 | 272 | #if 0 |
| 268 | 273 | if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) { |
diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index b8281fc..f963c95 100644
|
a
|
b
|
static int get_line(AVIOContext *pb, char *line, int line_size)
|
| 40 | 40 | return 0; |
| 41 | 41 | } |
| 42 | 42 | |
| | 43 | |
| | 44 | static void trim_right(char* p) |
| | 45 | { |
| | 46 | while (*p!='\0' && !av_isspace(*p)) |
| | 47 | p++; |
| | 48 | *p = '\0'; |
| | 49 | } |
| | 50 | |
| 43 | 51 | static int split_tag_value(char **tag, char **value, char *line) |
| 44 | 52 | { |
| | 53 | *tag = NULL; |
| | 54 | *value = NULL; |
| | 55 | |
| 45 | 56 | char *p = line; |
| | 57 | int foundData = 0; |
| 46 | 58 | |
| 47 | | while (*p != '\0' && *p != ':') |
| | 59 | while (*p != '\0' && *p != ':') { |
| | 60 | if (!av_isspace(*p)) { |
| | 61 | foundData = 1; |
| | 62 | } |
| 48 | 63 | p++; |
| 49 | | if (*p != ':') |
| 50 | | return AVERROR_INVALIDDATA; |
| | 64 | } |
| | 65 | if (*p != ':') { |
| | 66 | if (*p!='\0' || foundData) |
| | 67 | return AVERROR_INVALIDDATA; |
| | 68 | return 0; |
| | 69 | } |
| 51 | 70 | |
| 52 | 71 | *p = '\0'; |
| 53 | 72 | *tag = line; |
| | 73 | trim_right(*tag); |
| 54 | 74 | |
| 55 | 75 | p++; |
| 56 | 76 | |
| … |
… |
static int split_tag_value(char **tag, char **value, char *line)
|
| 59 | 79 | |
| 60 | 80 | *value = p; |
| 61 | 81 | |
| | 82 | trim_right(*value); |
| | 83 | |
| 62 | 84 | return 0; |
| 63 | 85 | } |
| 64 | 86 | |
| … |
… |
static int check_content_type(char *line)
|
| 67 | 89 | char *tag, *value; |
| 68 | 90 | int ret = split_tag_value(&tag, &value, line); |
| 69 | 91 | |
| 70 | | if (ret < 0) |
| | 92 | if (ret < 0 || tag == NULL || value == NULL) |
| 71 | 93 | return ret; |
| 72 | 94 | |
| 73 | 95 | if (av_strcasecmp(tag, "Content-type") || |
| … |
… |
static int parse_multipart_header(AVFormatContext *s)
|
| 165 | 187 | |
| 166 | 188 | ret = get_line(s->pb, line, sizeof(line)); |
| 167 | 189 | if (ret < 0) |
| 168 | | return ret; |
| | 190 | break; |
| 169 | 191 | |
| 170 | 192 | if (line[0] == '\0') |
| 171 | 193 | break; |
| … |
… |
static int parse_multipart_header(AVFormatContext *s)
|
| 173 | 195 | ret = split_tag_value(&tag, &value, line); |
| 174 | 196 | if (ret < 0) |
| 175 | 197 | return ret; |
| | 198 | if (value==NULL || tag==NULL) |
| | 199 | break; |
| 176 | 200 | |
| 177 | 201 | if (!av_strcasecmp(tag, "Content-type")) { |
| 178 | 202 | if (av_strcasecmp(value, "image/jpeg")) { |