aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-30 05:21:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-30 13:55:03 +0200
commitb3dfebd6416058d5b849317a7d96b3d9085943fd (patch)
tree6249f1b9da0ba56495a4f7dae74e60a0d9e57c6a
parent8bfb4d72dd9324fda14bb49dda3468ccba5873e2 (diff)
downloadffmpeg-b3dfebd6416058d5b849317a7d96b3d9085943fd.tar.gz
avformat/matroskadec: fix off by 1 error in matroska_read_seek()
Fixes out of array read Fixes: vp9-opus-crash.webm Found-by: Dale Curtis <dalecurtis@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 65847fa17b..213767c646 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3018,7 +3018,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
tracks[i].stream, st->index_entries[index].timestamp,
AVSEEK_FLAG_BACKWARD);
while (index_sub >= 0 &&
- index_min >= 0 &&
+ index_min > 0 &&
tracks[i].stream->index_entries[index_sub].pos < st->index_entries[index_min].pos &&
st->index_entries[index].timestamp - tracks[i].stream->index_entries[index_sub].timestamp < 30000000000 / matroska->time_scale)
index_min--;