aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-07-05 00:05:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-07-19 02:50:19 +0200
commit965f15551fb07f1c0be37fd369b0ab4462da0965 (patch)
tree00e8be3dd974cf85a66da9b2723203cdadf8e00e /libavcodec
parent0837678cbd332489cd89700df22d0a8da0e3721c (diff)
downloadffmpeg-965f15551fb07f1c0be37fd369b0ab4462da0965.tar.gz
avcodec/h264_slice: Fix signed integer overflow
Fixes: runtime error: signed integer overflow: 26 + 2147483644 cannot be represented in type 'int' Fixes: 2456/clusterfuzz-testcase-minimized-4822695051001856 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 7592d97f10134422d4509ab1287796af70e003ba) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_slice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 474400ba2f..d3f1360359 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1667,7 +1667,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
}
sl->last_qscale_diff = 0;
- tmp = pps->init_qp + get_se_golomb(&sl->gb);
+ tmp = pps->init_qp + (unsigned)get_se_golomb(&sl->gb);
if (tmp > 51 + 6 * (sps->bit_depth_luma - 8)) {
av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
return AVERROR_INVALIDDATA;