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>
(cherry picked from commit d719981273)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/4xm.c
This commit is contained in:
Martin Storsjö 2013-09-03 13:53:23 +03:00 committed by Luca Barbato
parent aade60ab16
commit 7b9bcd993c

View File

@ -136,6 +136,8 @@ static int parse_strk(AVFormatContext *s,
av_log(s, AV_LOG_ERROR, "current_track too large\n");
return AVERROR_INVALIDDATA;
}
if (track < 0)
return AVERROR_INVALIDDATA;
if (track + 1 > fourxm->track_count) {
AudioTrack *tmp = av_realloc(fourxm->tracks,
(track + 1) * sizeof(AudioTrack));