pb = avio_alloc_context(p->buf, p->buf_size, 0, NULL, NULL, NULL, NULL);
if (!pb)
- return AVERROR(ENOMEM);
+ return 0;
ret = (parse_multipart_header(pb, NULL)>0)?AVPROBE_SCORE_MAX:0;
int found_content_type = 0;
int ret, size = -1;
+ // get the CRLF as empty string
ret = get_line(pb, line, sizeof(line));
if (ret < 0)
return ret;
+ /* some implementation do not provide the required
+ * initial CRLF (see rfc1341 7.2.1)
+ */
+ if (!line[0]) {
+ ret = get_line(pb, line, sizeof(line));
+ if (ret < 0)
+ return ret;
+ }
+
if (strncmp(line, "--", 2))
return AVERROR_INVALIDDATA;
if (ret < 0)
return ret;
- // trailing empty line
- avio_skip(s->pb, 2);
-
return 0;
}