mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avformat/mxfenc: Fail on invalid FFV1 versions instead of asserting
Fixes: assertion failure Fixes: NwEesUvc9OLL Assertion failure Replicated through UnModified FFmpeg Assertion failure on extradata Replicated through API Found during triage of the security report AISLE-2026-0111-00534
This commit is contained in:
committed by
michaelni
parent
3e6cd5e760
commit
bb310f6044
@@ -2676,8 +2676,7 @@ static int mxf_parse_ffv1_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
ff_init_range_decoder(&c, st->codecpar->extradata, st->codecpar->extradata_size);
|
||||
ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
|
||||
v = get_ffv1_unsigned_symbol(&c, state);
|
||||
av_assert0(v >= 2);
|
||||
if (v > 4) {
|
||||
if (v < 2 || v > 4) {
|
||||
av_log(s, AV_LOG_ERROR, "unsupported ffv1 version %d\n", v);
|
||||
return 0;
|
||||
}
|
||||
@@ -2688,7 +2687,8 @@ static int mxf_parse_ffv1_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
|
||||
get_rac(&c, &keystate); // keyframe
|
||||
v = get_ffv1_unsigned_symbol(&c, state);
|
||||
av_assert0(v < 2);
|
||||
if (v >= 2)
|
||||
return 0;
|
||||
}
|
||||
sc->codec_ul = &mxf_ffv1_codec_uls[v];
|
||||
sc->sub_descriptor = FFV1SubDescriptor;
|
||||
|
||||
Reference in New Issue
Block a user