X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/efc068f39f6811cdc0e004d2acf4ef08b2b71c3e..HEAD:/src/lbximg.c?ds=sidebyside diff --git a/src/lbximg.c b/src/lbximg.c index 5beaaae..f997506 100644 --- a/src/lbximg.c +++ b/src/lbximg.c @@ -191,10 +191,10 @@ int parserange(unsigned frames, char *str, unsigned char *bits) return 0; } -int output(unsigned int frameno, const struct img_format *fmt, - unsigned char *pixels, unsigned char *pixel_mask, - unsigned int width, unsigned int height, - struct lbx_colour palette[static 256]) +static int output(unsigned int frameno, const struct img_format *fmt, + unsigned char *pixels, unsigned char *pixel_mask, + unsigned int width, unsigned int height, + struct lbx_colour *palette) { char name[strlen(outname) + sizeof ".65535.png"]; FILE *of; @@ -227,7 +227,7 @@ int output(unsigned int frameno, const struct img_format *fmt, return 0; } -static int loadoverride(FILE *f, struct lbx_colour palette[static 256]) +static int loadoverride(FILE *f, struct lbx_colour *palette) { struct lbx_image *img; int rc, ret = 0; @@ -376,7 +376,7 @@ decode(struct lbx_image *img, FILE *palf, FILE *override, int fmt, char **argv) assert(fmt >= 0 && fmt < sizeof formats / sizeof formats[0]); npixels = img->width; - if (img->height && npixels >= SIZE_MAX / img->height) { + if (img->height && npixels >= (size_t)-1 / img->height) { tool_err(-1, "image too large"); goto err; }