avcodec/ffv1dec: reject unsupported ffv1 versions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Jerome Martinez 2023-04-04 16:57:03 +02:00 committed by Michael Niedermayer
parent 916be62da1
commit f0cd5610e0
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 5 additions and 0 deletions

View File

@ -439,6 +439,11 @@ static int read_extra_header(FFV1Context *f)
av_log(f->avctx, AV_LOG_ERROR, "Invalid version in global header\n");
return AVERROR_INVALIDDATA;
}
if (f->version > 4) {
av_log(f->avctx, AV_LOG_ERROR, "unsupported version %d\n",
f->version);
return AVERROR_PATCHWELCOME;
}
if (f->version > 2) {
c->bytestream_end -= 4;
f->micro_version = get_symbol(c, state, 0);