diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-16 18:22:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-16 18:36:39 +0200 |
commit | efe1ba7201b3bb609d3a41091e15e875137f3f32 (patch) | |
tree | 433c5dc77afe9197e1a10b555350f60eb3c0fe00 /libavcodec/diracdec.c | |
parent | a30165c4a8044e1d5527c1302b5a5cb473e0913d (diff) | |
download | ffmpeg-streaming-efe1ba7201b3bb609d3a41091e15e875137f3f32.zip ffmpeg-streaming-efe1ba7201b3bb609d3a41091e15e875137f3f32.tar.gz |
diracdec: check lowdelay bytes.
Fixes division by zero
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r-- | libavcodec/diracdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 5c4ed88..b5395db 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -980,6 +980,11 @@ static int dirac_unpack_idwt_params(DiracContext *s) s->lowdelay.bytes.num = svq3_get_ue_golomb(gb); s->lowdelay.bytes.den = svq3_get_ue_golomb(gb); + if (s->lowdelay.bytes.den <= 0) { + av_log(s->avctx,AV_LOG_ERROR,"Invalid lowdelay.bytes.den\n"); + return AVERROR_INVALIDDATA; + } + /* [DIRAC_STD] 11.3.5 Quantisation matrices (low-delay syntax). quant_matrix() */ if (get_bits1(gb)) { av_log(s->avctx,AV_LOG_DEBUG,"Low Delay: Has Custom Quantization Matrix!\n"); |