diff options
Diffstat (limited to 'fitz/res_pixmap.c')
-rw-r--r-- | fitz/res_pixmap.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 29dd95a0..b7cf5f58 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -136,14 +136,16 @@ fz_pixmap_height(fz_context *ctx, fz_pixmap *pix) void fz_clear_pixmap(fz_context *ctx, fz_pixmap *pix) { - memset(pix->samples, 0, pix->w * pix->h * pix->n); + memset(pix->samples, 0, (unsigned int)(pix->w * pix->h * pix->n)); } void fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value) { if (value == 255) - memset(pix->samples, 255, pix->w * pix->h * pix->n); + { + memset(pix->samples, 255, (unsigned int)(pix->w * pix->h * pix->n)); + } else { int k, x, y; @@ -175,9 +177,9 @@ fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_bbox r) return; srcspan = src->w * src->n; - srcp = src->samples + srcspan * (r.y0 - src->y) + src->n * (r.x0 - src->x); + srcp = src->samples + (unsigned int)(srcspan * (r.y0 - src->y) + src->n * (r.x0 - src->x)); destspan = dest->w * dest->n; - destp = dest->samples + destspan * (r.y0 - dest->y) + dest->n * (r.x0 - dest->x); + destp = dest->samples + (unsigned int)(destspan * (r.y0 - dest->y) + dest->n * (r.x0 - dest->x)); if (src->n == dest->n) { @@ -273,11 +275,11 @@ fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, fz_ return; destspan = dest->w * dest->n; - destp = dest->samples + destspan * (r.y0 - dest->y) + dest->n * (r.x0 - dest->x); + destp = dest->samples + (unsigned int)(destspan * (r.y0 - dest->y) + dest->n * (r.x0 - dest->x)); if (value == 255) do { - memset(destp, 255, w * dest->n); + memset(destp, 255, (unsigned int)(w * dest->n)); destp += destspan; } while (--y); @@ -389,7 +391,7 @@ void fz_invert_pixmap_rect(fz_pixmap *image, fz_bbox rect) for (y = y0; y < y1; y++) { - p = image->samples + (y * image->w + x0) * image->n; + p = image->samples + (unsigned int)((y * image->w + x0) * image->n); for (x = x0; x < x1; x++) { for (n = image->n; n > 0; n--, p++) |