[FFmpeg-devel] [PATCH 1/2] avformat/mov: do not emit zero sized packets

Marton Balint cus at passwd.hu
Mon Dec 5 01:50:01 EET 2022


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mov.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 29bd3103e3..935b2f8d9f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8772,6 +8772,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
             goto retry;
         }
 
+        /* Empty packet or corrupt index? */
+        if (!sample->size)
+            goto retry;
+
         if (st->codecpar->codec_id == AV_CODEC_ID_EIA_608 && sample->size > 8)
             ret = get_eia608_packet(sc->pb, pkt, sample->size);
         else
-- 
2.35.3



More information about the ffmpeg-devel mailing list