Commit 1ea44a55 authored by Moritz Barsnick's avatar Moritz Barsnick Committed by Michael Niedermayer

avformat/mpjpegdec: fix strict boundary search string

According to RFC1341, the multipart boundary indicated by the
Content-Type header must be prepended by CRLF + "--", and followed
by CRLF. In the case of strict MIME header boundary handling, the
"--" was forgotten to add.

Fixes trac #7921.

A side effect is that this coincidentally breaks enforcement of
strict MIME headers against servers running motion < 3.4.1, where
the boundary announcement in the HTTP headers incorrectly used the
prefix "--", which exactly matched this bug's behavior.
Signed-off-by: 's avatarMoritz Barsnick <barsnick@gmx.net>
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a3846fe6
......@@ -302,8 +302,9 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
boundary = mpjpeg_get_boundary(s->pb);
}
if (boundary != NULL) {
mpjpeg->boundary = boundary;
mpjpeg->searchstr = av_asprintf( "\r\n%s\r\n", boundary );
mpjpeg->boundary = av_asprintf("--%s", boundary);
mpjpeg->searchstr = av_asprintf("\r\n--%s\r\n", boundary);
av_freep(&boundary);
} else {
mpjpeg->boundary = av_strdup("--");
mpjpeg->searchstr = av_strdup("\r\n--");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment