Commit 12cf61c3 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc: Fix undefined shifts

Found-by: Clang -fsanitize=shift
Reported-by: 's avatarThierry Foucu <tfoucu@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 04c52389
......@@ -858,7 +858,7 @@ static void hls_sao_param(HEVCContext *s, int rx, int ry)
} else if (sao->offset_sign[c_idx][i]) {
sao->offset_val[c_idx][i + 1] = -sao->offset_val[c_idx][i + 1];
}
sao->offset_val[c_idx][i + 1] <<= log2_sao_offset_scale;
sao->offset_val[c_idx][i + 1] *= 1 << log2_sao_offset_scale;
}
}
}
......@@ -1300,7 +1300,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
x_off += mv->x >> 2;
y_off += mv->y >> 2;
src += y_off * srcstride + (x_off << s->sps->pixel_shift);
src += y_off * srcstride + x_off * (1 << s->sps->pixel_shift);
if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
......@@ -1455,7 +1455,7 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
x_off += mv->x >> (2 + hshift);
y_off += mv->y >> (2 + vshift);
src0 += y_off * srcstride + (x_off << s->sps->pixel_shift);
src0 += y_off * srcstride + x_off * (1 << s->sps->pixel_shift);
if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment