diff mbox series

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

Message ID 20221204235002.26754-1-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,1/2] avformat/mov: do not emit zero sized packets | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marton Balint Dec. 4, 2022, 11:50 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mov.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

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