summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/avidec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index b10c3efa61..86f857b1e3 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -240,6 +240,8 @@ static int read_odml_index(AVFormatContext *s, int64_t frame_num)
} else {
int64_t offset, pos;
int duration;
+ int ret;
+
offset = avio_rl64(pb);
avio_rl32(pb); /* size */
duration = avio_rl32(pb);
@@ -257,7 +259,7 @@ static int read_odml_index(AVFormatContext *s, int64_t frame_num)
if (avio_seek(pb, offset + 8, SEEK_SET) < 0)
return -1;
avi->odml_depth++;
- read_odml_index(s, frame_num);
+ ret = read_odml_index(s, frame_num);
avi->odml_depth--;
frame_num += duration;
@@ -265,7 +267,8 @@ static int read_odml_index(AVFormatContext *s, int64_t frame_num)
av_log(s, AV_LOG_ERROR, "Failed to restore position after reading index\n");
return -1;
}
-
+ if (ret < 0)
+ return ret;
}
}
avi->index_loaded = 2;