dsputil: Split off IDCT bits into their own context
[ffmpeg.git] / libavcodec / proresdec.c
index c65d729..03f63d9 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "libavutil/intmath.h"
 #include "avcodec.h"
-#include "dsputil.h"
+#include "idctdsp.h"
 #include "internal.h"
 #include "proresdata.h"
 #include "proresdsp.h"
@@ -393,12 +393,16 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out,
             return 0;
 
         run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]);
+        if (run < 0)
+            return AVERROR_INVALIDDATA;
 
         bits_left = get_bits_left(gb);
         if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
             return AVERROR_INVALIDDATA;
 
         level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1;
+        if (level < 0)
+            return AVERROR_INVALIDDATA;
 
         pos += run + 1;
         if (pos >= max_coeffs)