diff mbox series

[FFmpeg-devel,2/9] avcodec/asvdec: Use init_get_bits8()

Message ID 20201013091017.1899676-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 4f3edcdcbc6553b5e717f03cd903355b3f6d276e
Headers show
Series [FFmpeg-devel,1/9] avcodec/asvdec: Reduce the size of some VLCs | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 13, 2020, 9:10 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/asvdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Oct. 14, 2020, 7:08 p.m. UTC | #1
On Tue, Oct 13, 2020 at 11:10:10AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/asvdec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index a21e4277b3..6198188fc5 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -235,7 +235,9 @@  static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             a->bitstream_buffer[i] = ff_reverse[buf[i]];
     }
 
-    init_get_bits(&a->gb, a->bitstream_buffer, buf_size * 8);
+    ret = init_get_bits8(&a->gb, a->bitstream_buffer, buf_size);
+    if (ret < 0)
+        return ret;
 
     for (mb_y = 0; mb_y < a->mb_height2; mb_y++) {
         for (mb_x = 0; mb_x < a->mb_width2; mb_x++) {