Browse Source

hq_hqa: Validate get_vlc2 return value

The `hq_ac_vlc.table` is incomplete, so unaccounted symbol return -1
as value.
tags/n2.7
Luca Barbato 10 years ago
parent
commit
28eddef689
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/hq_hqa.c

+ 4
- 1
libavcodec/hq_hqa.c View File

@@ -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;


Loading…
Cancel
Save