avcodec/hevc: Fix undefined shifts

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-03-16 14:27:11 +01:00
parent 04c52389d8
commit 12cf61c3b2
1 changed files with 3 additions and 3 deletions

View File

@ -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 ||