Opened 5 years ago
Last modified 5 years ago
#7921 new defect
"-strict_mime_boundary 1" searches for incorrect boundary
Reported by: | barsnick | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | unspecified | Keywords: | mpjpegdec |
Cc: | barsnick@gmx.net | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
The mpjpegdec option "-strict_mime_boundary 1" applies an incorrect boundary to its search in the stream.
How to reproduce:
Use the option "-strict_mime_boundary 1" with an mpjpeg input stream which adheres to the boundary definitions, and doesn't provide a Content-Length MIME header. (Examples given in #5023.)
Prerequisite for reproduction: Fix #7920.
Note:
See TracTickets
for help on using tickets.
Root cause:
The boundary parameter string found in the Content-Type header is not prepended with
"--"
. The exact match stringmpjpeg->boundary
is taken is taken directly from the parsing of the header; the precise binary match stringmpjpeg->searchstr
is also created from the parsing, with additional"\r\n"
added before and after.RFC1341 says:
In other words, the boundary found in the header's parameter shall be encapsulated as:
"\r\n" + "--" + boundary from header + "\r\n"
What mpjpegdec does is to only encapsulate it with
"\r\n"
:https://github.com/FFmpeg/FFmpeg/blob/b401a4ab8aa85c536bd9eee0da8f51551b66c70e/libavformat/mpjpegdec.c#L309