Suppress gcc -Wsign-conversion warnings
@@ -369,28 +369,28 @@ image_buffer_resize(
if (width > image->width) { /* if width is extended */
for (n = 0; n < min_height; ++n) {
/* copy from source image */
- memcpy(alt_buffer + (size_t)width * n,
- image->data + (size_t)image->width * n,
+ memcpy(alt_buffer + (size_t)width * (size_t)n,
+ image->data + (size_t)image->width * (size_t)n,
(size_t)image->width);
/* fill extended area with background color */
- memset(alt_buffer + (size_t)width * n + image->width,
+ memset(alt_buffer + (size_t)width * (size_t)n + (size_t)image->width,
bgindex,
(size_t)(width - image->width));
}
} else {
for (n = 0; n < min_height; ++n) {
/* copy from source image */
- memcpy(alt_buffer + (size_t)width * n,
- image->data + (size_t)image->width * n,
+ memcpy(alt_buffer + (size_t)width * (size_t)n,
+ image->data + (size_t)image->width * (size_t)n,
(size_t)width);
}
}
if (height > image->height) { /* if height is extended */
/* fill extended area with background color */
- memset(alt_buffer + (size_t)width * image->height,
+ memset(alt_buffer + (size_t)width * (size_t)image->height,
bgindex,
- (size_t)(width * (height - image->height)));
+ (size_t)width * (size_t)(height - image->height));
}
/* free source image */
@@ -674,7 +674,7 @@ sixel_decode_raw_impl(
if (context->repeat_count <= 1) {
for (i = 0; i < 6; i++) {
if ((bits & sixel_vertical_mask) != 0) {
- pos = (size_t)image->width * (context->pos_y + i) + context->pos_x;
+ pos = (size_t)image->width * (size_t)(context->pos_y + i) + (size_t)context->pos_x;
image->data[pos] = context->color_index;
if (context->max_x < context->pos_x) {
context->max_x = context->pos_x;
@@ -698,7 +698,7 @@ sixel_decode_raw_impl(
c <<= 1;
}
for (y = context->pos_y + i; y < context->pos_y + i + n; ++y) {
- memset(image->data + image->width * y + context->pos_x,
+ memset(image->data + (size_t)image->width * (size_t)y + (size_t)context->pos_x,
context->color_index,
(size_t)context->repeat_count);
}
