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

Tim Walker git at videolan.org
Fri Oct 11 09:20:48 CEST 2013


ffmpeg | branch: master | Tim Walker <tdskywalker at gmail.com> | Wed Oct  9 11:47:04 2013 +0200| [5f5ada3dbf97e306a74250ba8dcf8619ad59b020] | committer: Luca Barbato

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>

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

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

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 5ca38c6..31251ac 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -303,7 +303,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