}
if (setjmp(png_jmpbuf(png))) {
- free(row);
png_destroy_write_struct(&png, &info);
goto err;
}
png_destroy_write_struct(&png, &info);
fclose(of);
+ free(row);
if (verbose)
printf("wrote %s\n", name);
-
return 0;
-
err:
fclose(of);
remove(name);
static int loadoverride(FILE *f, struct lbx_colour palette[static 256])
{
- LBX_IMG *overimg = lbximg_fopen(f);
+ LBX_IMG *overimg = lbximg_open(f, &lbx_default_fops, NULL);
struct lbx_imginfo info;
if (!overimg) {
lbximg_getinfo(img, &info);
- framebits = malloc(info.nframes / CHAR_BIT + 1);
+ framebits = calloc(1, info.nframes / CHAR_BIT + 1);
if (!framebits) {
return EXIT_FAILURE;
}
printf("%s is %ux%u LBX image, %u frame(s)%s%s\n",
name, info.width, info.height, info.nframes,
info.palettesz ? ", embedded palette" : "",
+ info.chunk ? ", chunked" : "",
info.looping ? ", loops" : "");
}