aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_ps.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-25 00:00:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-25 01:13:17 +0200
commit63e7bfe78e6d764097e845248f6d77b28b2b235c (patch)
treee42e1577a5adb2b80d0e6d4afb73654f1f3e7c52 /libavcodec/hevc_ps.c
parent5c1f4330d4c35299ada5b5cfc7cf0b0be0abddab (diff)
downloadffmpeg-63e7bfe78e6d764097e845248f6d77b28b2b235c.tar.gz
avcodec/hevc_ps: Fix max_dec_buffer check
Fixes: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 2339/clusterfuzz-testcase-minimized-6663164320022528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r--libavcodec/hevc_ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 0fa50a1508..6cbf40a6e0 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -941,9 +941,9 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
sps->temporal_layer[i].max_dec_pic_buffering = get_ue_golomb_long(gb) + 1;
sps->temporal_layer[i].num_reorder_pics = get_ue_golomb_long(gb);
sps->temporal_layer[i].max_latency_increase = get_ue_golomb_long(gb) - 1;
- if (sps->temporal_layer[i].max_dec_pic_buffering > HEVC_MAX_DPB_SIZE) {
+ if (sps->temporal_layer[i].max_dec_pic_buffering > (unsigned)HEVC_MAX_DPB_SIZE) {
av_log(avctx, AV_LOG_ERROR, "sps_max_dec_pic_buffering_minus1 out of range: %d\n",
- sps->temporal_layer[i].max_dec_pic_buffering - 1);
+ sps->temporal_layer[i].max_dec_pic_buffering - 1U);
return AVERROR_INVALIDDATA;
}
if (sps->temporal_layer[i].num_reorder_pics > sps->temporal_layer[i].max_dec_pic_buffering - 1) {