diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-30 01:28:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-30 01:35:22 +0200 |
commit | 13c56e9a9cf18f33bcbc2dc1a5cf2a5f98ca9702 (patch) | |
tree | 2838419c98b51fbfaae7a9bea293794bf7c79ba2 | |
parent | 6d6eabd399eb20b69d10234ef746f2d3d4c72dcb (diff) | |
download | ffmpeg-13c56e9a9cf18f33bcbc2dc1a5cf2a5f98ca9702.tar.gz |
4xm: check for invalid zero ac coeffs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/4xm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 3e0e681331..dc84e96953 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -525,7 +525,12 @@ static int decode_i_block(FourXContext *f, int16_t *block) if (code == 0xf0) { i += 16; } else { - level = get_xbits(&f->gb, code & 0xf); + if (code & 0xf) { + level = get_xbits(&f->gb, code & 0xf); + } else { + av_log(f->avctx, AV_LOG_ERROR, "0 coeff\n"); + return AVERROR_INVALIDDATA; + } i += code >> 4; if (i >= 64) { av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i); |