diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-11-02 20:02:40 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-11-03 18:10:50 +0000 |
commit | 6e2a71d0b743c105c71f88a7ed1de0851cdd90ca (patch) | |
tree | 8bd6d452d6b4686f509e6478edf13f267621d6f3 /source/fitz/load-pnm.c | |
parent | 0289421f68b810cee600a5a047507091ff4731df (diff) | |
download | mupdf-6e2a71d0b743c105c71f88a7ed1de0851cdd90ca.tar.xz |
Fix signed/unsigned and size_t/int/fz_off_t warnings.
All seen in MSVC, mostly in 64bit builds.
Diffstat (limited to 'source/fitz/load-pnm.c')
-rw-r--r-- | source/fitz/load-pnm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/fitz/load-pnm.c b/source/fitz/load-pnm.c index 1bb5098b..4c827e43 100644 --- a/source/fitz/load-pnm.c +++ b/source/fitz/load-pnm.c @@ -253,7 +253,7 @@ pnm_ascii_read_image(fz_context *ctx, struct info *pnm, unsigned char *p, unsign fz_throw(ctx, FZ_ERROR_GENERIC, "image height must be > 0"); if (pnm->width <= 0) fz_throw(ctx, FZ_ERROR_GENERIC, "image width must be > 0"); - if (pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) + if ((unsigned int)pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) fz_throw(ctx, FZ_ERROR_GENERIC, "image too large"); if (!onlymeta) @@ -332,7 +332,7 @@ pnm_binary_read_image(fz_context *ctx, struct info *pnm, unsigned char *p, unsig fz_throw(ctx, FZ_ERROR_GENERIC, "image height must be > 0"); if (pnm->width <= 0) fz_throw(ctx, FZ_ERROR_GENERIC, "image width must be > 0"); - if (pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) + if ((unsigned int)pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) fz_throw(ctx, FZ_ERROR_GENERIC, "image too large"); if (!onlymeta) @@ -494,7 +494,7 @@ pam_binary_read_image(fz_context *ctx, struct info *pnm, unsigned char *p, unsig fz_throw(ctx, FZ_ERROR_GENERIC, "image height must be > 0"); if (pnm->width <= 0) fz_throw(ctx, FZ_ERROR_GENERIC, "image width must be > 0"); - if (pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) + if ((unsigned int)pnm->height > UINT_MAX / pnm->width / fz_colorspace_n(ctx, pnm->cs) / (pnm->bitdepth / 8 + 1)) fz_throw(ctx, FZ_ERROR_GENERIC, "image too large"); if (!onlymeta) |