diff mbox

[FFmpeg-devel] lavf/mov: Do not fail hard for truncated stsz atom

Message ID CAB0OVGqVqM8PDdLRk3ee+yLcxMAp=B4Op=qy0Ejftrw14szS3A@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos June 16, 2018, 12:25 p.m. UTC
Hi!

Attached patch fixes ticket #6433 for me, this is also what vlc does.

Please comment, Carl Eugen

Comments

Carl Eugen Hoyos June 19, 2018, 8:50 p.m. UTC | #1
2018-06-16 14:25 GMT+02:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> Attached patch fixes ticket #6433 for me, this is also what vlc does.

Patch applied.

Carl Eugen
diff mbox

Patch

From adfa5858eacbb6210e5e9da20284b3a27523e5b1 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 16 Jun 2018 14:22:52 +0200
Subject: [PATCH] lavf/mov: Do not fail hard for truncated stsz atoms.

Fixes ticket #6433.
---
 libavformat/mov.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0acf981..1011763 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2841,7 +2841,8 @@  static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (ret < 0) {
         av_freep(&sc->sample_sizes);
         av_free(buf);
-        return ret;
+        av_log(c->fc, AV_LOG_WARNING, "STSZ atom truncated\n");
+        return 0;
     }
 
     init_get_bits(&gb, buf, 8*num_bytes);
-- 
1.7.10.4