Commit fc8cff96 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 207e6deb
...@@ -1112,7 +1112,7 @@ decode_intra_mb: ...@@ -1112,7 +1112,7 @@ decode_intra_mb:
dquant= get_se_golomb(&sl->gb); dquant= get_se_golomb(&sl->gb);
sl->qscale += dquant; sl->qscale += (unsigned)dquant;
if (((unsigned)sl->qscale) > max_qp){ if (((unsigned)sl->qscale) > max_qp){
if (sl->qscale < 0) sl->qscale += max_qp + 1; if (sl->qscale < 0) sl->qscale += max_qp + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment