[FFmpeg-cvslog] 4xm: Check that the read track value is non-negative

Martin Storsjö git at videolan.org
Wed Sep 4 12:55:06 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Tue Sep  3 13:53:23 2013 +0300| [d719981273bc779c7d1e879d88404fd867f93a0e] | committer: Martin Storsjö

4xm: Check that the read track value is non-negative

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d719981273bc779c7d1e879d88404fd867f93a0e
---

 libavformat/4xm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index f003c9c..7a87c36 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);



More information about the ffmpeg-cvslog mailing list