Commit 28eddef6 authored by Luca Barbato's avatar Luca Barbato

hq_hqa: Validate get_vlc2 return value

The `hq_ac_vlc.table` is incomplete, so unaccounted symbol return -1
as value.
parent a78f5548
...@@ -75,7 +75,10 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64], ...@@ -75,7 +75,10 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
} }
for (;;) { 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]; pos += ff_hq_ac_skips[val];
if (pos >= 64) if (pos >= 64)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment