mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
wmalosslessdec: rawpcm_tile fixes to keep get_bits() values within defined range.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d0212bb032
commit
59edf33f7b
@ -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]) {
|
||||
|
Loading…
Reference in New Issue
Block a user