[FFmpeg-devel] [PATCH 1/2] lavf/movdec: fix demuxing files with 0-entry trun atoms

Rodger Combs rodger.combs at gmail.com
Sat Mar 16 12:22:02 EET 2019


Regressed in 4a9d32baca3af0d1831f9556a922c7ab5b426b10
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a7d444b0ee..0dfee2e7c4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4739,6 +4739,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     flags = avio_rb24(pb);
     entries = avio_rb32(pb);
     av_log(c->fc, AV_LOG_TRACE, "flags 0x%x entries %u\n", flags, entries);
+    if (entries == 0)
+        return 0;
 
     if ((uint64_t)entries+sc->ctts_count >= UINT_MAX/sizeof(*sc->ctts_data))
         return AVERROR_INVALIDDATA;
-- 
2.20.1



More information about the ffmpeg-devel mailing list