summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-03 13:53:23 +0300
committerMartin Storsjö <martin@martin.st>2013-09-03 22:57:36 +0300
commitd719981273bc779c7d1e879d88404fd867f93a0e (patch)
treef4118af3c4b272a1ff88d9d020e34f9da0c375e8 /libavformat/4xm.c
parent5bcd3ae5b167fb74215520b01d5d810e0c8986ab (diff)
4xm: Check that the read track value is non-negative
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index f003c9c25a..7a87c3695a 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -131,6 +131,8 @@ static int parse_strk(AVFormatContext *s,
return AVERROR_INVALIDDATA;
track = AV_RL32(buf + 8);
+ if (track < 0)
+ return AVERROR_INVALIDDATA;
if (track + 1 > fourxm->track_count) {
if (av_reallocp_array(&fourxm->tracks, track + 1, sizeof(AudioTrack)))
return AVERROR(ENOMEM);