Browse Source

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>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
d719981273
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/4xm.c

+ 2
- 0
libavformat/4xm.c View File

@@ -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