1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/mov: perform sanity checks for heif before index building

Fixes: undefined NULL pointer use
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-6363211175493632

This performs equivalent sanity checks as are done in mov_read_trak()
before mov_build_index()

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-01-07 23:21:32 +01:00
parent 16b3d3e3eb
commit afbc3a1b23

View File

@ -10332,7 +10332,8 @@ static int mov_parse_heif_items(AVFormatContext *s)
st->codecpar->width = item->width; st->codecpar->width = item->width;
st->codecpar->height = item->height; st->codecpar->height = item->height;
if (sc->sample_count != 1 || sc->chunk_count != 1) err = sanity_checks(s, sc, item->item_id);
if (err)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
sc->sample_sizes[0] = item->extent_length; sc->sample_sizes[0] = item->extent_length;