[FFmpeg-cvslog] shorten: Fix out-of-array read

Tim Walker git at videolan.org
Sun Jan 12 17:07:09 CET 2014


ffmpeg | branch: release/1.1 | Tim Walker <tdskywalker at gmail.com> | Wed Oct  9 11:47:04 2013 +0200| [a0866c71293db80f271f11176eae72217d773e9a] | committer: Tim Walker

shorten: Fix out-of-array read

pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit 5f5ada3dbf97e306a74250ba8dcf8619ad59b020)
Signed-off-by: Tim Walker <tdskywalker at gmail.com>

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

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

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index ea22772..22976e0 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -307,7 +307,7 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
     } else {
         /* fixed LPC coeffs */
         pred_order = command;
-        if (pred_order > FF_ARRAY_ELEMS(fixed_coeffs)) {
+        if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) {
             av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",
                    pred_order);
             return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list