Commit a1926a29 authored by Anton Khirnov's avatar Anton Khirnov

hevc: avoid invalid shifts of negative values

parent 515b69f8
...@@ -1494,7 +1494,7 @@ static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride, ...@@ -1494,7 +1494,7 @@ static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
x_off += mv->x >> 2; x_off += mv->x >> 2;
y_off += mv->y >> 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 || if (x_off < extra_left || y_off < extra_top ||
x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] || 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, ...@@ -1548,8 +1548,8 @@ static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
x_off += mv->x >> 3; x_off += mv->x >> 3;
y_off += mv->y >> 3; y_off += mv->y >> 3;
src1 += y_off * src1stride + (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 << 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 || if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - 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