ffmpeg | branch: master | Moritz Barsnick <barsn...@gmx.net> | Mon Oct 7 00:19:29 2019 +0200| [1ea44a55fe36c92420cba3542de256a1507f52fe] | committer: 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: Moritz Barsnick <barsn...@gmx.net> Reviewed-by: Paul B Mahol <one...@gmail.com> Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ea44a55fe36c92420cba3542de256a1507f52fe --- libavformat/mpjpegdec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index c0ffaf616e..24bf232db2 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -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--"); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".