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

Michael Niedermayer git at videolan.org
Sat Nov 10 17:49:31 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 10 17:14:04 2012 +0100| [fd4f4923cce6a2cbf4f48640b4ac706e614a1594] | 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>

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

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

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 5653e9a..f032ceb 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