diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-10-05 00:19:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-11-01 16:40:19 +0100 |
commit | 68cc1744db828e929b74f96478c18f1d226510be (patch) | |
tree | cb562016fd6e02530df3baea51a733d54951c07b | |
parent | d35eecd24fb62a4060ef89dfdd1c45f5549fb71d (diff) | |
download | ffmpeg-68cc1744db828e929b74f96478c18f1d226510be.tar.gz |
avcodec/evc_parse: Check tid
The check is based on not infinite looping. It is likely
a more strict check can be done
Fixes: Infinite loop
Fixes: 62473/clusterfuzz-testcase-minimized-ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-5719883750703104
Fixes: 62765/clusterfuzz-testcase-minimized-ffmpeg_dem_EVC_fuzzer-6448531252314112
Fixes: 63378/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGPS_fuzzer-6504993844494336
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: "Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics" <d.kozinski@samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/evc_parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c index 255706ce61..43b8dabf8b 100644 --- a/libavcodec/evc_parse.c +++ b/libavcodec/evc_parse.c @@ -174,6 +174,9 @@ int ff_evc_derive_poc(const EVCParamSets *ps, const EVCParserSliceHeader *sh, } else { int SubGopLength = 1 << sps->log2_sub_gop_length; + if (tid > (SubGopLength > 1 ? 1 + av_log2(SubGopLength - 1) : 0)) + return AVERROR_INVALIDDATA; + if (tid == 0) { poc->PicOrderCntVal = poc->prevPicOrderCntVal + SubGopLength; poc->DocOffset = 0; |