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:
committed by
michaelni
parent
d09971584b
commit
5603b5992d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user