diff --git a/source/rotate_argb.cc b/source/rotate_argb.cc index 8cfaed034..6342b0647 100644 --- a/source/rotate_argb.cc +++ b/source/rotate_argb.cc @@ -86,7 +86,7 @@ static int ARGBRotate90(const uint8_t* src_argb, // Rotate by 90 is a ARGBTranspose with the source read // from bottom to top. So set the source pointer to the end // of the buffer and flip the sign of the source stride. - src_argb += src_stride_argb * (height - 1); + src_argb += (ptrdiff_t)src_stride_argb * (height - 1); src_stride_argb = -src_stride_argb; return ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width, height); @@ -101,7 +101,7 @@ static int ARGBRotate270(const uint8_t* src_argb, // Rotate by 270 is a ARGBTranspose with the destination written // from bottom to top. So set the destination pointer to the end // of the buffer and flip the sign of the destination stride. - dst_argb += dst_stride_argb * (width - 1); + dst_argb += (ptrdiff_t)dst_stride_argb * (width - 1); dst_stride_argb = -dst_stride_argb; return ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width, height); @@ -114,8 +114,8 @@ static int ARGBRotate180(const uint8_t* src_argb, int width, int height) { // Swap first and last row and mirror the content. Uses a temporary row. - const uint8_t* src_bot = src_argb + src_stride_argb * (height - 1); - uint8_t* dst_bot = dst_argb + dst_stride_argb * (height - 1); + const uint8_t* src_bot = src_argb + (ptrdiff_t)src_stride_argb * (height - 1); + uint8_t* dst_bot = dst_argb + (ptrdiff_t)dst_stride_argb * (height - 1); int half_height = (height + 1) >> 1; int y; void (*ARGBMirrorRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =