[FFmpeg-cvslog] alsdec: Check k used for rice decoder.
Michael Niedermayer
git at videolan.org
Thu Oct 25 17:10:38 CEST 2012
ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 7 17:25:47 2012 +0200| [592ba67815581a0ba371b57a7e3dd3079760fd9d] | committer: Reinhard Tartler
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>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>
(cherry picked from commit 23aae62c2cb4504a09ceb8cd0cabc1c8b260f521)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=592ba67815581a0ba371b57a7e3dd3079760fd9d
---
libavcodec/alsdec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d5e09c5..8932996 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;
More information about the ffmpeg-cvslog
mailing list