diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-07 17:25:47 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-01-04 07:43:38 +0100 |
commit | aa45b90804ab21175b8c116bd8e5eb4b4e85fbcb (patch) | |
tree | 1106a94d8173483fbf9e7e37ba0ca668220f36ae /libavcodec/alsdec.c | |
parent | 6996a2f796898753b85d9465653f995148ebc753 (diff) | |
download | ffmpeg-aa45b90804ab21175b8c116bd8e5eb4b4e85fbcb.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>
(cherry picked from commit 23aae62c2cb4504a09ceb8cd0cabc1c8b260f521)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r-- | libavcodec/alsdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index cdf2a7c0f1..cfe8fd37cb 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -650,6 +650,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; |