diff mbox series

[FFmpeg-devel,2/3] Support size = 1 and size = 0 special cases in probing

Message ID 20210205191132.6027-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/3] avformat/mov: factor size out of probe code
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Feb. 5, 2021, 7:11 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9406e42f49..70f76caff5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7113,6 +7113,11 @@  static int mov_probe(const AVProbeData *p)
         if ((offset + 8) > (unsigned int)p->buf_size)
             break;
         size = AV_RB32(p->buf + offset);
+        if (size == 1 && offset + 16 > (unsigned int)p->buf_size) {
+            size = AV_RB64(p->buf+offset + 8);
+        } else if (size == 0) {
+            size = p->buf_size - offset;
+        }
         tag = AV_RL32(p->buf + offset + 4);
         switch(tag) {
         /* check for obvious tags */