diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-16 14:27:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-16 14:27:11 +0100 |
commit | 12cf61c3b26151806c87ba8774503673e407ac33 (patch) | |
tree | 3ad291eeae3ebcaff90d0abe369d6e87e99d46f6 /libavcodec/hevc.c | |
parent | 04c52389d8d40b18c84b64f809c438a9533e1b47 (diff) | |
download | ffmpeg-12cf61c3b26151806c87ba8774503673e407ac33.tar.gz |
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>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index b7ad29a081..feb8cd4114 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -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 || |