aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-04-22 21:59:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 00:21:49 +0200
commit927ff67ab44b08fa0f57ac73faa2b438cbf740ce (patch)
tree4809d9eecfa8876141bf798b6e5ac28642e52bc1
parent44eabc5d5d9ed479cad1df0acc8f172093e44364 (diff)
downloadffmpeg-927ff67ab44b08fa0f57ac73faa2b438cbf740ce.tar.gz
avcodec/h264_cavlc: Fix undefined behavior on qscale overflow
Fixes: 1214/clusterfuzz-testcase-minimized-6130606599569408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit fc8cff96ed45dfdb91ed03e9942845f28be0e770) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/h264_cavlc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 069b52129c..72dfaaab45 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -1112,7 +1112,7 @@ decode_intra_mb:
dquant= get_se_golomb(&sl->gb);
- sl->qscale += dquant;
+ sl->qscale += (unsigned)dquant;
if (((unsigned)sl->qscale) > max_qp){
if (sl->qscale < 0) sl->qscale += max_qp + 1;