summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-07-11 20:19:51 +0200
committerAnton Khirnov <anton@khirnov.net>2015-08-21 08:45:37 +0200
commita1926a29fb4325afa46842883f197c74d4535c36 (patch)
treec555758e87e625ba9ec998a88927a988b4fbeff1 /libavcodec/hevc.c
parent515b69f8f8e9a24cfaee95d8c1f63f265d8582fe (diff)
hevc: avoid invalid shifts of negative values
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 0dfe7a29d6..6395563ab2 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1494,7 +1494,7 @@ static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
x_off += mv->x >> 2;
y_off += mv->y >> 2;
- src += y_off * srcstride + (x_off << s->ps.sps->pixel_shift);
+ src += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift));
if (x_off < extra_left || y_off < extra_top ||
x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] ||
@@ -1548,8 +1548,8 @@ static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
x_off += mv->x >> 3;
y_off += mv->y >> 3;
- src1 += y_off * src1stride + (x_off << s->ps.sps->pixel_shift);
- src2 += y_off * src2stride + (x_off << s->ps.sps->pixel_shift);
+ src1 += y_off * src1stride + (x_off * (1 << s->ps.sps->pixel_shift));
+ src2 += y_off * src2stride + (x_off * (1 << s->ps.sps->pixel_shift));
if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||