[FFmpeg-cvslog] diracdec: check wavelet depth, prevent out of array read.

Michael Niedermayer git at videolan.org
Sun Nov 11 18:22:20 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 11 17:20:10 2012 +0100| [3ba58433e17cb6019e512e7fa5cf4e38415217d3] | committer: Michael Niedermayer

diracdec: check wavelet depth, prevent out of array read.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ba58433e17cb6019e512e7fa5cf4e38415217d3
---

 libavcodec/diracdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index c70a0c7..6e81491 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++) {



More information about the ffmpeg-cvslog mailing list