Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From e0884eadf6a15e93142131b695f48776f9a0ac31 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Niedermayer <michaelni@gmx.at> |
| 3 | Date: Sat, 10 Nov 2012 17:14:04 +0100 |
| 4 | Subject: [PATCH] alac: fix nb_samples < order case |
| 5 | |
| 6 | Upstream-Status: Backport |
| 7 | |
| 8 | Commit e0884eadf6a15e93142131b695f48776f9a0ac31 release/1.0 |
| 9 | |
| 10 | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind |
| 11 | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
| 12 | (cherry picked from commit fd4f4923cce6a2cbf4f48640b4ac706e614a1594) |
| 13 | --- |
| 14 | libavcodec/alac.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/libavcodec/alac.c b/libavcodec/alac.c |
| 18 | index 9cd1737..e8e844a 100644 |
| 19 | --- a/gst-libs/ext/libav/libavcodec/alac.c |
| 20 | +++ b/gst-libs/ext/libav/libavcodec/alac.c |
| 21 | @@ -278,7 +278,7 @@ static void predictor_decompress_fir_ada |
| 22 | |
| 23 | /* read warm-up samples */ |
| 24 | if (predictor_coef_num > 0) |
| 25 | - for (i = 0; i < predictor_coef_num; i++) { |
| 26 | + for (i = 0; i < predictor_coef_num && i < output_size; i++) { |
| 27 | int32_t val; |
| 28 | |
| 29 | val = buffer_out[i] + error_buffer[i+1]; |
| 30 | -- |