Commit 724e6b3d authored by Gyan Doshi's avatar Gyan Doshi

avformat/yuv4mpegdec: better error logging

parent 609dfb40
...@@ -53,10 +53,14 @@ static int yuv4_read_header(AVFormatContext *s) ...@@ -53,10 +53,14 @@ static int yuv4_read_header(AVFormatContext *s)
break; break;
} }
} }
if (i == MAX_YUV4_HEADER) if (i == MAX_YUV4_HEADER) {
return -1; av_log(s, AV_LOG_ERROR, "Header too large.\n");
if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) return AVERROR(EINVAL);
return -1; }
if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) {
av_log(s, AV_LOG_ERROR, "Invalid magic number for yuv4mpeg.\n");
return AVERROR(EINVAL);
}
header_end = &header[i + 1]; // Include space header_end = &header[i + 1]; // Include space
for (tokstart = &header[strlen(Y4M_MAGIC) + 1]; for (tokstart = &header[strlen(Y4M_MAGIC) + 1];
......
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