[FFmpeg-cvslog] avcodec/vqcdec: Check init_get_bits8() for failure

Michael Niedermayer git at videolan.org
Sat May 25 01:57:34 EEST 2024


ffmpeg | branch: release/6.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun May 19 00:47:11 2024 +0200| [d54198256e7318673c9967d5f348eb6299cc1245] | committer: Michael Niedermayer

avcodec/vqcdec: Check init_get_bits8() for failure

Fixes: CID1516090 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Peter Ross <pross at xvid.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 6a9302739f5b20791eac7f40d9d999f822227fd1)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/vqcdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
index 462d810a2f..17e4f1a959 100644
--- a/libavcodec/vqcdec.c
+++ b/libavcodec/vqcdec.c
@@ -145,10 +145,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid
     GetBitContext gb;
     uint8_t * vectors = s->vectors;
     uint8_t * vectors_end = s->vectors + (width * height * 3) / 2;
+    int ret;
 
     memset(vectors, 0, 3 * width * height / 2);
 
-    init_get_bits8(&gb, buf, size);
+    ret = init_get_bits8(&gb, buf, size);
+    if (ret < 0)
+        return ret;
 
     for (int i = 0; i < 3 * width * height / 2 / 32; i++) {
         uint8_t * dst = vectors;



More information about the ffmpeg-cvslog mailing list