X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmpjpegdec.c;h=c9fcf47f1e221a1950e883939e2af887c934cbbf;hb=6711aa21e263a270ecd2d6a6ee1b673e665ce98a;hp=3429d1907a2f918795f495b6a309c9ad1340048c;hpb=92186f2d1006c1a2cfcac79a656477f1ddeb34d9;p=ffmpeg diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index 3429d1907a2..c9fcf47f1e2 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -198,6 +198,7 @@ static int parse_multipart_header(AVIOContext *pb, } if (!av_strstart(line, expected_boundary, NULL)) { + if (log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Expected boundary '%s' not found, instead found a line of %zu bytes\n", @@ -228,6 +229,7 @@ static int parse_multipart_header(AVIOContext *pb, if (!av_strcasecmp(tag, "Content-type")) { if (av_strcasecmp(value, "image/jpeg")) { + if (log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Unexpected %s : %s\n", tag, value); @@ -237,6 +239,7 @@ static int parse_multipart_header(AVIOContext *pb, } else if (!av_strcasecmp(tag, "Content-Length")) { *size = parse_content_length(value); if ( *size < 0 ) + if (log_ctx) av_log(log_ctx, AV_LOG_WARNING, "Invalid Content-Length value : %s\n", value); @@ -260,8 +263,10 @@ static char* mpjpeg_get_boundary(AVIOContext* pb) start = mime_type; while (start != NULL && *start != '\0') { start = strchr(start, ';'); - if (start) - start = start+1; + if (!start) + break; + + start = start+1; while (av_isspace(*start)) start++;