summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index f918b1fc57..848991af5b 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -137,7 +137,8 @@ static int parse_strk(AVFormatContext *s,
return AVERROR_INVALIDDATA;
track = AV_RL32(buf + 8);
- if ((unsigned)track >= UINT_MAX / sizeof(AudioTrack) - 1) {
+ if ((unsigned)track >= UINT_MAX / sizeof(AudioTrack) - 1 ||
+ track >= s->max_streams) {
av_log(s, AV_LOG_ERROR, "current_track too large\n");
return AVERROR_INVALIDDATA;
}