wmalosslessdec: avoid reading 0 bits with get_bits

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9020d514e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Andreas Cadhalpun 2015-07-03 00:01:56 +02:00 committed by Michael Niedermayer
parent 151554e1eb
commit 1ec0541ae0
1 changed files with 1 additions and 1 deletions

View File

@ -488,7 +488,7 @@ static int decode_cdlms(WmallDecodeCtx *s)
if ((1 << cbits) < s->cdlms[c][i].scaling + 1)
cbits++;
s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2;
s->cdlms[c][i].bitsend = (cbits ? get_bits(&s->gb, cbits) : 0) + 2;
shift_l = 32 - s->cdlms[c][i].bitsend;
shift_r = 32 - s->cdlms[c][i].scaling - 2;
for (j = 0; j < s->cdlms[c][i].coefsend; j++)