summaryrefslogtreecommitdiff
path: root/libavcodec/hq_hqa.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-04-21 14:42:21 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-04-22 12:27:43 +0200
commit28eddef689f2b4843a84f7d05fd9614246f92cc4 (patch)
tree30c70fddd518f57d179d0e0e6b2a757e304779a2 /libavcodec/hq_hqa.c
parenta78f5548d94f23ce23cece41edf0fe9d18926de6 (diff)
hq_hqa: Validate get_vlc2 return value
The `hq_ac_vlc.table` is incomplete, so unaccounted symbol return -1 as value.
Diffstat (limited to 'libavcodec/hq_hqa.c')
-rw-r--r--libavcodec/hq_hqa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index 4b18eaef78..ae378e6524 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -75,7 +75,10 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
}
for (;;) {
- val = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);
+ val = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);
+ if (val < 0)
+ return AVERROR_INVALIDDATA;
+
pos += ff_hq_ac_skips[val];
if (pos >= 64)
break;