[FFmpeg-cvslog] alac: fix nb_samples < order case

Michael Niedermayer git at videolan.org
Mon Dec 3 21:14:37 CET 2012


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 10 17:14:04 2012 +0100| [e0884eadf6a15e93142131b695f48776f9a0ac31] | committer: Michael Niedermayer

alac: fix nb_samples < order case

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit fd4f4923cce6a2cbf4f48640b4ac706e614a1594)

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

 libavcodec/alac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 9cd1737..e8e844a 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -224,7 +224,7 @@ static void lpc_prediction(int32_t *error_buffer, int32_t *buffer_out,
     }
 
     /* read warm-up samples */
-    for (i = 1; i <= lpc_order; i++)
+    for (i = 1; i <= lpc_order && i < nb_samples; i++)
         buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i], bps);
 
     /* NOTE: 4 and 8 are very common cases that could be optimized. */



More information about the ffmpeg-cvslog mailing list