aboutsummaryrefslogtreecommitdiffstats
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 15:26:37 +0200
commit0a36341e967d69136c5a904b58c809f9d38c84c8 (patch)
tree39dc40df92a663d906b3b4eecab6e09284a2073e
parent1a21edf7b885df9e48b142b6080c8265a9d3643c (diff)
downloadffmpeg-0a36341e967d69136c5a904b58c809f9d38c84c8.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>
-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 506e6775dc..86b72dff7f 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1805,7 +1805,7 @@ static int h264_slice_header_parse(const 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;