avcodec/mlpdec: use get_bits_long for huff lsbs
authorJai Luthra <me@jailuthra.in>
Fri, 7 Feb 2020 20:16:12 +0000 (01:46 +0530)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 8 Feb 2020 17:20:43 +0000 (18:20 +0100)
lsb bits may go beyond 25 bits, so to be safe use get_bits_long

Signed-off-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mlpdec.c

index 22a6efd..1a2c0f2 100644 (file)
@@ -266,7 +266,7 @@ static inline int read_huff_channels(MLPDecodeContext *m, GetBitContext *gbp,
             return AVERROR_INVALIDDATA;
 
         if (lsb_bits > 0)
-            result = (result << lsb_bits) + get_bits(gbp, lsb_bits);
+            result = (result << lsb_bits) + get_bits_long(gbp, lsb_bits);
 
         result  += cp->sign_huff_offset;
         result *= 1 << quant_step_size;