Browse Source

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 7592d97f10)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.3
Michael Niedermayer 8 years ago
parent
commit
0a36341e96
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/h264_slice.c

+ 1
- 1
libavcodec/h264_slice.c View File

@@ -1805,7 +1805,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
} }


sl->last_qscale_diff = 0; 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)) { if (tmp > 51 + 6 * (sps->bit_depth_luma - 8)) {
av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp); av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;


Loading…
Cancel
Save