[FFmpeg-cvslog] avformat/mov: check that sample and chunk count is 1 for HEIF

James Almer git at videolan.org
Sun Jul 28 23:29:31 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Jun 28 21:06:53 2024 -0300| [2aa63784b533f461785c3e767e354e84c7e2c8c2] | committer: James Almer

avformat/mov: check that sample and chunk count is 1 for HEIF

Fixes NULL pointer dereference in broken/fuzzed streams.

Signed-off-by: James Almer <jamrial at gmail.com>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b74e43e214..dc77599faa 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10063,6 +10063,9 @@ static int mov_read_header(AVFormatContext *s)
             st->codecpar->width  = item->width;
             st->codecpar->height = item->height;
 
+            if (sc->sample_count != 1 || sc->chunk_count != 1)
+                return AVERROR_INVALIDDATA;
+
             sc->sample_sizes[0]  = item->extent_length;
             sc->chunk_offsets[0] = item->extent_offset + offset;
 



More information about the ffmpeg-cvslog mailing list