aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-12-15 18:17:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-30 21:11:32 +0100
commit41a706b9125c0c27dda50996723ceade871b0a9a (patch)
tree50bbca6628a02e4448b4f2691e716e45304fd177
parent7a5c73896394c3f53371b7c91f0da99dbf0c2ae2 (diff)
downloadffmpeg-41a706b9125c0c27dda50996723ceade871b0a9a.tar.gz
avcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()
Fixes: signed integer overflow: 2147483647 + 1073741824 cannot be represented in type 'int' Fixes: 4555/clusterfuzz-testcase-minimized-4505532481142784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 0ee143558d55b590774dba69cff5a16eda089a4d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hevc_cabac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c
index e27c54ed4b..3c22e30faa 100644
--- a/libavcodec/hevc_cabac.c
+++ b/libavcodec/hevc_cabac.c
@@ -635,8 +635,10 @@ int ff_hevc_cu_qp_delta_abs(HEVCContext *s)
suffix_val += 1 << k;
k++;
}
- if (k == CABAC_MAX_BIN)
+ if (k == CABAC_MAX_BIN) {
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
+ return AVERROR_INVALIDDATA;
+ }
while (k--)
suffix_val += get_cabac_bypass(&s->HEVClc->cc) << k;