avcodec/h264_cabac: Fix runtime error: negation of -2147483648 cannot be represented...
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 15 Mar 2017 02:48:59 +0000 (03:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 16 Mar 2017 15:16:05 +0000 (16:16 +0100)
Fixes: 858/clusterfuzz-testcase-5168477042114560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264_cabac.c

index 17a4bda..a1a16da 100644 (file)
@@ -1725,7 +1725,7 @@ decode_cabac_residual_internal(const H264Context *h, H264SliceContext *sl,
                 ((type*)block)[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6; \
             } \
         } else { \
-            int coeff_abs = 2; \
+            unsigned coeff_abs = 2; \
             ctx = coeff_abs_levelgt1_ctx[is_dc && chroma422][node_ctx] + abs_level_m1_ctx_base; \
             node_ctx = coeff_abs_level_transition[1][node_ctx]; \
 \