aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-07 17:25:47 +0200
committerJustin Ruggles <justin.ruggles@gmail.com>2012-09-17 14:17:26 -0400
commit23aae62c2cb4504a09ceb8cd0cabc1c8b260f521 (patch)
tree267c4101a98bc6da31403c15fc66b6cda635c6d9 /libavcodec
parente3496e5dbe277e056800ebe7740ac6467d35d5cb (diff)
downloadffmpeg-23aae62c2cb4504a09ceb8cd0cabc1c8b260f521.tar.gz
alsdec: Check k used for rice decoder.
Values that fail this check will cause failure of decode_rice() Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 56d7f2faca..ef12253271 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] > 32) {
+ av_log(avctx, AV_LOG_ERROR, "k invalid for rice code.\n");
+ return AVERROR_INVALIDDATA;
+ }
if (get_bits1(gb))
*bd->shift_lsbs = get_bits(gb, 4) + 1;