diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-07-03 00:01:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-20 04:43:41 +0200 |
commit | 1ca226989c31c49a7d96ba834679dc26d9b4083a (patch) | |
tree | 07baeb181065781d416cfa5d33559088bf390c66 | |
parent | a4cb97067b4c679a1bc5f8fa5406b81978885e8a (diff) | |
download | ffmpeg-1ca226989c31c49a7d96ba834679dc26d9b4083a.tar.gz |
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 f9020d514e9ed5043496a710b36daba1ab182e97)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/wmalosslessdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index fcadbc034b..be74799812 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -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++) |