1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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>
This commit is contained in:
Michael Niedermayer 2017-04-22 21:59:29 +02:00
parent 207e6debf8
commit fc8cff96ed

View File

@ -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;