aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-05-19 00:47:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-05-19 22:12:55 +0200
commit6a9302739f5b20791eac7f40d9d999f822227fd1 (patch)
tree370cf01c14f0360916c157f33994a9bbb5e36a44 /libavcodec
parent4a8506c794d92744514aac26ac9a1b898a7401ab (diff)
downloadffmpeg-6a9302739f5b20791eac7f40d9d999f822227fd1.tar.gz
avcodec/vqcdec: Check init_get_bits8() for failure
Fixes: CID1516090 Unchecked return value Sponsored-by: Sovereign Tech Fund Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vqcdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
index 5c6cab3c1a..bb69844327 100644
--- a/libavcodec/vqcdec.c
+++ b/libavcodec/vqcdec.c
@@ -147,10 +147,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;