Merge commit '28eddef689f2b4843a84f7d05fd9614246f92cc4'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Apr 2015 19:57:12 +0000 (21:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Apr 2015 19:57:16 +0000 (21:57 +0200)
* commit '28eddef689f2b4843a84f7d05fd9614246f92cc4':
  hq_hqa: Validate get_vlc2 return value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hq_hqa.c

index 388c63e..7d14e27 100644 (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;