1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avfilter/vsrc_life: reject pattern files larger than INT_MAX bytes

The prescan of the pattern file counts bytes, columns and lines in int,
which overflows for a file larger than INT_MAX bytes.

Found during triage/review of the security report WY5AA7zfuNDv
This commit is contained in:
Michael Niedermayer
2026-10-05 23:56:06 +02:00
committed by michaelni
parent d09971584b
commit 5603b5992d

View File

@@ -238,6 +238,10 @@ static int init_pattern_from_file(AVFilterContext *ctx)
0, ctx)) < 0)
return ret;
av_freep(&life->filename);
if (life->file_bufsize > INT_MAX) {
av_log(ctx, AV_LOG_ERROR, "Pattern file too large\n");
return AVERROR(EINVAL);
}
/* prescan file to get the number of lines and the maximum width */
w = 0;