Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/avidec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 90480dd9d6..1971ea0fe8 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1753,7 +1753,10 @@ static int avi_load_index(AVFormatContext *s)
size = avio_rl32(pb);
if (avio_feof(pb))
break;
- next = avio_tell(pb) + size + (size & 1);
+ next = avio_tell(pb);
+ if (next < 0 || next > INT64_MAX - size - (size & 1))
+ break;
+ next += size + (size & 1LL);
if (tag == MKTAG('i', 'd', 'x', '1') &&
avi_read_idx1(s, size) >= 0) {