[FFmpeg-cvslog] avcodec/alsdec: check predictor order against block length

Michael Niedermayer git at videolan.org
Sun Feb 23 17:46:58 CET 2014


ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 16 13:12:39 2014 +0100| [6341a7006d74bf557c9ffb2a19f15e511d9b3b2b] | committer: Michael Niedermayer

avcodec/alsdec: check predictor order against block length

Fixes out of array access
Fixes: abd3c041acbcb816be113455d138166b-asan_heap-oob_b11634_3707_cov_1707137151_als_05_2ch48k16b.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 18f94df8af04f2c02a25a7dec512289feff6517f)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/alsdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 7b99d86..e1e6738 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -688,7 +688,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
         } else {
             *bd->opt_order = sconf->max_order;
         }
-
+        if (*bd->opt_order > bd->block_length) {
+            *bd->opt_order = bd->block_length;
+            av_log(avctx, AV_LOG_ERROR, "Predictor order too large.\n");
+            return AVERROR_INVALIDDATA;
+        }
         opt_order = *bd->opt_order;
 
         if (opt_order) {



More information about the ffmpeg-cvslog mailing list