avformat/mov: Propagate errors in mov_switch_root.
authorJacob Trimble <modmaker-at-google.com@ffmpeg.org>
Mon, 20 Nov 2017 20:05:02 +0000 (12:05 -0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 21 Nov 2017 02:13:03 +0000 (03:13 +0100)
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index 0b8f8ad..b6cdf3a 100644 (file)
@@ -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));