Fixes: signed integer overflow: -2147483648 - 5 cannot be represented in type 'int' Fixes: 58066/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5312995835379712
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1529,9 +1529,9 @@ static int pps_scc_extension(GetBitContext *gb, AVCodecContext *avctx, · 1528 unmodified lines | |||
| 1529 | pps->pps_curr_pic_ref_enabled_flag = get_bits1(gb); | 1529 | pps->pps_curr_pic_ref_enabled_flag = get_bits1(gb); |
| 1530 | if (pps->residual_adaptive_colour_transform_enabled_flag = get_bits1(gb)) { | 1530 | if (pps->residual_adaptive_colour_transform_enabled_flag = get_bits1(gb)) { |
| 1531 | pps->pps_slice_act_qp_offsets_present_flag = get_bits1(gb); | 1531 | pps->pps_slice_act_qp_offsets_present_flag = get_bits1(gb); |
| 1532 | pps->pps_act_y_qp_offset = get_se_golomb_long(gb) - 5; | 1532 | pps->pps_act_y_qp_offset = get_se_golomb(gb) - 5; |
| 1533 | pps->pps_act_cb_qp_offset = get_se_golomb_long(gb) - 5; | 1533 | pps->pps_act_cb_qp_offset = get_se_golomb(gb) - 5; |
| 1534 | pps->pps_act_cr_qp_offset = get_se_golomb_long(gb) - 3; | 1534 | pps->pps_act_cr_qp_offset = get_se_golomb(gb) - 3; |
| 1535 | 1535 | ||
| 1536 | #define CHECK_QP_OFFSET(name) (pps->pps_act_ ## name ## _qp_offset <= -12 || \ | 1536 | #define CHECK_QP_OFFSET(name) (pps->pps_act_ ## name ## _qp_offset <= -12 || \ |
| 1537 | pps->pps_act_ ## name ## _qp_offset >= 12) | 1537 | pps->pps_act_ ## name ## _qp_offset >= 12) |