[FFmpeg-cvslog] avcodec/wavpack: use init_get_bits8()

Paul B Mahol git at videolan.org
Wed Oct 30 12:41:52 CET 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Oct 29 09:46:32 2013 +0000| [82e576046c6b96576865855a3901b23c93f6317d] | committer: Paul B Mahol

avcodec/wavpack: use init_get_bits8()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

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

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 94a4cb4..6036a5c 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -847,7 +847,8 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
         case WP_ID_DATA:
             s->sc.offset = bytestream2_tell(&gb);
             s->sc.size   = size * 8;
-            init_get_bits(&s->gb, gb.buffer, size * 8);
+            if ((ret = init_get_bits8(&s->gb, gb.buffer, size)) < 0)
+                return ret;
             s->data_size = size * 8;
             bytestream2_skip(&gb, size);
             got_bs       = 1;
@@ -861,7 +862,8 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
             }
             s->extra_sc.offset = bytestream2_tell(&gb);
             s->extra_sc.size   = size * 8;
-            init_get_bits(&s->gb_extra_bits, gb.buffer, size * 8);
+            if ((ret = init_get_bits8(&s->gb_extra_bits, gb.buffer, size)) < 0)
+                return ret;
             s->crc_extra_bits  = get_bits_long(&s->gb_extra_bits, 32);
             bytestream2_skip(&gb, size);
             s->got_extra_bits  = 1;



More information about the ffmpeg-cvslog mailing list