[FFmpeg-cvslog] wavpack: use get_bits_long to read up to 32 bits

Andreas Cadhalpun git at videolan.org
Thu Jul 23 02:17:06 CEST 2015


ffmpeg | branch: release/2.6 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sat Jun 27 20:16:12 2015 +0200| [21769e3884ea6a5e1c063219f5b9dd04f6e3207d] | committer: Michael Niedermayer

wavpack: use get_bits_long to read up to 32 bits

get_bits should not be used for more than 25 bits.

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

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21769e3884ea6a5e1c063219f5b9dd04f6e3207d
---

 libavcodec/wavpack.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index b51a21c..d91b66c 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
             if (t >= 2) {
                 if (get_bits_left(gb) < t - 1)
                     goto error;
-                t = get_bits(gb, t - 1) | (1 << (t - 1));
+                t = get_bits_long(gb, t - 1) | (1 << (t - 1));
             } else {
                 if (get_bits_left(gb) < 0)
                     goto error;
@@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
             } else {
                 if (get_bits_left(gb) < t2 - 1)
                     goto error;
-                t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
+                t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
             }
         }
 



More information about the ffmpeg-cvslog mailing list