diff mbox

[FFmpeg-devel] avformat/mov: Propagate errors in mov_switch_root.

Message ID 20171120200502.17593-1-modmaker@google.com
State Accepted
Commit 2d9cf3bf16b94cd9db10dabad695c69c5cff4f58
Headers show

Commit Message

Jacob Trimble Nov. 20, 2017, 8:05 p.m. UTC
Signed-off-by: Jacob Trimble <modmaker@google.com>
---
 libavformat/mov.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Nov. 21, 2017, 2:11 a.m. UTC | #1
On Mon, Nov 20, 2017 at 12:05:02PM -0800, Jacob Trimble wrote:
> Signed-off-by: Jacob Trimble <modmaker@google.com>
> ---
>  libavformat/mov.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

applied

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0b8f8ad24b..b6cdf3a52a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6753,6 +6753,7 @@  static int should_retry(AVIOContext *pb, int error_code) {
 
 static int mov_switch_root(AVFormatContext *s, int64_t target, int index)
 {
+    int ret;
     MOVContext *mov = s->priv_data;
 
     if (index >= 0 && index < mov->frag_index.nb_items)
@@ -6775,8 +6776,10 @@  static int mov_switch_root(AVFormatContext *s, int64_t target, int index)
 
     mov->found_mdat = 0;
 
-    if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
-        avio_feof(s->pb))
+    ret = mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX });
+    if (ret < 0)
+        return ret;
+    if (avio_feof(s->pb))
         return AVERROR_EOF;
     av_log(s, AV_LOG_TRACE, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));