diff mbox series

[FFmpeg-devel] avcodec/mlpdec: use get_bits_long for huff lsbs

Message ID 20200207201612.28825-1-me@jailuthra.in
State Accepted
Headers show
Series [FFmpeg-devel] avcodec/mlpdec: use get_bits_long for huff lsbs
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Jai Luthra Feb. 7, 2020, 8:16 p.m. UTC
lsb bits may go beyond 25 bits, so to be safe use get_bits_long

Signed-off-by: Jai Luthra <me@jailuthra.in>
---
 libavcodec/mlpdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Feb. 8, 2020, 4:56 p.m. UTC | #1
On Sat, Feb 08, 2020 at 01:46:12AM +0530, Jai Luthra wrote:
> lsb bits may go beyond 25 bits, so to be safe use get_bits_long
> 
> Signed-off-by: Jai Luthra <me@jailuthra.in>
> ---
>  libavcodec/mlpdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 22a6efd63d..1a2c0f29ac 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -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;