From 841bab94f51828c29a8d1903a511d7c6a96a6c36 Mon Sep 17 00:00:00 2001
From: Umair Khan <omerjerk@gmail.com>
Date: Mon, 13 Nov 2017 00:20:16 +0530
Subject: [PATCH 1/1] libavcodec/als: fix address sanitization error in decoder

opt_order can be more than the block_length, which is not valid.

Signed-off-by: Umair Khan <omerjerk@gmail.com>
---
 libavcodec/alsdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 13bd52f297..1a7132fec7 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -926,6 +926,7 @@ static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
     // reconstruct all samples from residuals
     if (bd->ra_block) {
         for (smp = 0; smp < opt_order; smp++) {
+        for (smp = 0; smp < FFMIN(opt_order, block_length); smp++) {
             y = 1 << 19;
 
             for (sb = 0; sb < smp; sb++)
-- 
2.14.2

