[FFmpeg-devel] [PATCH 4/4] avcodec/evc_parse: Check tid

Michael Niedermayer michael at niedermayer.cc
Thu Oct 5 01:59:21 EEST 2023


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

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/evc_parse.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c
index 20b6849041a..8c0ef16f3ad 100644
--- a/libavcodec/evc_parse.c
+++ b/libavcodec/evc_parse.c
@@ -178,6 +178,9 @@ int ff_evc_derive_poc(const EVCParamSets *ps, const EVCParserSliceHeader *sh,
         } else {
             int SubGopLength = 1 << sps->log2_sub_gop_length;
 
+            if (tid > 1 + av_log2(SubGopLength - 1))
+                return AVERROR_INVALIDDATA;
+
             if (tid == 0) {
                 poc->PicOrderCntVal = poc->prevPicOrderCntVal + SubGopLength;
                 poc->DocOffset = 0;
-- 
2.17.1



More information about the ffmpeg-devel mailing list