summaryrefslogtreecommitdiffstats
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-29 19:16:22 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-29 19:56:07 +0200
commit1b8741a6843f3f4667c81c2d63d3182858aa534f (patch)
treec315b163c275a68f7b8b5340091b5d2dff7c094a /libavformat/4xm.c
parentdae8505492748d619753b1949123a7ca3680cc3d (diff)
downloadffmpeg-streaming-1b8741a6843f3f4667c81c2d63d3182858aa534f.zip
ffmpeg-streaming-1b8741a6843f3f4667c81c2d63d3182858aa534f.tar.gz
4xm: fix division by zero caused by bps<8
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 19ebffd..a794e88 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -200,6 +200,11 @@ static int fourxm_read_header(AVFormatContext *s)
ret = AVERROR_INVALIDDATA;
goto fail;
}
+ if(!fourxm->tracks[current_track].adpcm && fourxm->tracks[current_track].bits<8){
+ av_log(s, AV_LOG_ERROR, "bits unspecified for non ADPCM\n");
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
i += 8 + size;
/* allocate a new AVStream */
OpenPOWER on IntegriCloud