@@ -7501,12 +7501,12 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR_PATCHWELCOME;
}
item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
- if (item_count > 1) {
+ if (item_count != 1) {
// For still AVIF images, we only support one item. Second item will
// generally be found for AVIF images with alpha channel. We don't
// support them as of now.
- av_log(c->fc, AV_LOG_ERROR, "iloc: item_count > 1 not supported.\n");
- return AVERROR_PATCHWELCOME;
+ av_log(c->fc, AV_LOG_ERROR, "iloc: item_count != 1 not supported.\n");
+ return item_count ? AVERROR_PATCHWELCOME : AVERROR_INVALIDDATA;
}
// Populate the necessary fields used by mov_build_index.
Fixes: out of array access Fixes: 47899/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5706852010164224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/mov.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)