[FFmpeg-cvslog] avformat/mov: perform sanity checks for heif before index building

Michael Niedermayer git at videolan.org
Thu Jan 23 03:14:33 EET 2025


ffmpeg | branch: release/7.1 | Michael Niedermayer <michael at niedermayer.cc> | Tue Jan  7 23:21:32 2025 +0100| [0bb8a38c10a16c6956baabbf0dd9a2f634c89a01] | committer: Michael Niedermayer

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 at chromium.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit afbc3a1b23b3ba3e5a3f2820228a5fe51b517be7)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0bb8a38c10a16c6956baabbf0dd9a2f634c89a01
---

 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6918a6e045..695b975147 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10136,7 +10136,8 @@ static int mov_parse_heif_items(AVFormatContext *s)
         st->codecpar->width  = item->width;
         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;
 
         sc->sample_sizes[0]  = item->extent_length;



More information about the ffmpeg-cvslog mailing list