aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-07 19:34:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-07 19:59:00 +0200
commit59edf33f7bfd3b50ca7f7ad95d8aad5c32c7f1af (patch)
tree16042ce9f5ea958629f0d1c7fc64cdee27c9c233 /libavcodec
parentd0212bb0323b5e65a23d44a4af3757fe5e7be2d9 (diff)
downloadffmpeg-59edf33f7bfd3b50ca7f7ad95d8aad5c32c7f1af.tar.gz
wmalosslessdec: rawpcm_tile fixes to keep get_bits() values within defined range.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmalosslessdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 22e6710d72..ab7af9552c 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -936,12 +936,16 @@ static int decode_subframe(WmallDecodeCtx *s)
if (rawpcm_tile) {
int bits = s->bits_per_sample - padding_zeroes;
+ if (bits <= 0 ) {
+ av_log(s->avctx, AV_LOG_ERROR, "rawpcm_tile bits invalid\n");
+ return -1;
+ }
av_dlog(s->avctx, "RAWPCM %d bits per sample. "
"total %d bits, remain=%d\n", bits,
bits * s->num_channels * subframe_len, get_bits_count(&s->gb));
for (i = 0; i < s->num_channels; i++)
for (j = 0; j < subframe_len; j++)
- s->channel_coeffs[i][j] = get_sbits(&s->gb, bits);
+ s->channel_coeffs[i][j] = get_sbits_long(&s->gb, bits);
} else {
for (i = 0; i < s->num_channels; i++)
if (s->is_channel_coded[i]) {