diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 17:20:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 17:20:36 +0100 |
commit | 3ba58433e17cb6019e512e7fa5cf4e38415217d3 (patch) | |
tree | 2a0852769b033061eb62e5a03b3bca92e313fd73 /libavcodec | |
parent | 8c4145343d3963c0c6ab94d11774815ff0bb28e5 (diff) | |
download | ffmpeg-3ba58433e17cb6019e512e7fa5cf4e38415217d3.tar.gz |
diracdec: check wavelet depth, prevent out of array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/diracdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index c70a0c7902..6e814913d5 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -996,6 +996,10 @@ static int dirac_unpack_idwt_params(DiracContext *s) s->lowdelay.quant[level][3] = svq3_get_ue_golomb(gb); } } else { + if (s->wavelet_depth > 4) { + av_log(s->avctx,AV_LOG_ERROR,"Mandatory custom low delay matrix missing for depth %d\n", s->wavelet_depth); + return AVERROR_INVALIDDATA; + } /* default quantization matrix */ for (level = 0; level < s->wavelet_depth; level++) for (i = 0; i < 4; i++) { |