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>
pull/35/head
Martin Storsjö 11 years ago
parent 5bcd3ae5b1
commit d719981273
  1. 2
      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);

Loading…
Cancel
Save