diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-29 19:16:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:06:52 +0200 |
commit | ee6c1670df0bc230e99c3b68f66807af4ebf5e69 (patch) | |
tree | 94ccbcee565232b2013a4255b9cf51b4b194b0fb | |
parent | 9e4a68a76c25f82ec30d6d02ee3dba6db787de4d (diff) | |
download | ffmpeg-ee6c1670df0bc230e99c3b68f66807af4ebf5e69.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>
(cherry picked from commit 1b8741a6843f3f4667c81c2d63d3182858aa534f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/4xm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index b4dd3d4416..755a21168c 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -195,6 +195,11 @@ static int fourxm_read_header(AVFormatContext *s, ret= -1; 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 */ |