[FFmpeg-devel] [PATCH 2/2] avformat/mpjpegdec: fix strict boundary search string

Michael Niedermayer michael at niedermayer.cc
Fri May 24 12:58:51 EEST 2019


On Thu, May 23, 2019 at 06:06:43PM +0200, Moritz Barsnick wrote:
> 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.
> 
> Signed-off-by: Moritz Barsnick <barsnick at gmx.net>
> ---
>  libavformat/mpjpegdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
> index a23469c0ec..f145766e6e 100644
> --- a/libavformat/mpjpegdec.c
> +++ b/libavformat/mpjpegdec.c
> @@ -306,8 +306,8 @@ 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);

memleak

also a testcase would be good to have, idealy in fate

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190524/1c654506/attachment.sig>


More information about the ffmpeg-devel mailing list