[FFmpeg-cvslog] alsdec: Check k used for rice decoder.

Michael Niedermayer git at videolan.org
Sat Apr 7 20:57:12 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr  7 17:25:47 2012 +0200| [6c3d6a214c6a5b0a7e9c4aa1990d1c5b290806d5] | committer: Michael Niedermayer

alsdec: Check k used for rice decoder.

Values that fail this check will cause failure of decode_rice()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/alsdec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index b98473e..ef784df 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -651,6 +651,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
         for (k = 1; k < sub_blocks; k++)
             s[k] = s[k - 1] + decode_rice(gb, 0);
     }
+    for (k = 1; k < sub_blocks; k++)
+        if (s[k] < 0 || s[k] > 32) {
+            av_log(avctx, AV_LOG_ERROR, "k invalid for rice code.\n");
+            return -1;
+        }
 
     if (get_bits1(gb))
         *bd->shift_lsbs = get_bits(gb, 4) + 1;



More information about the ffmpeg-cvslog mailing list