termux-packages/x11-packages/mtpaint/mtpaint-3.40_src_png.c.patch

70 lines
1.8 KiB
Diff

diff -uNr mtpaint-3.40/src/png.c mtpaint-3.40.mod/src/png.c
--- mtpaint-3.40/src/png.c 2011-10-27 23:56:24.000000000 +0300
+++ mtpaint-3.40.mod/src/png.c 2018-06-24 23:31:47.945560204 +0300
@@ -1510,7 +1510,7 @@
int res, val, disposal, bpp, cmask, lastzero = FALSE;
- if (!(giffy = DGifOpenFileName(file_name))) return (-1);
+ if (!(giffy = DGifOpenFileName(file_name, NULL))) return (-1);
/* Init state structure */
memset(&stat, 0, sizeof(stat));
@@ -1608,7 +1608,7 @@
}
res = 1;
fail: mem_free_chanlist(w_set.img);
- DGifCloseFile(giffy);
+ DGifCloseFile(giffy, NULL);
return (res);
}
@@ -1621,7 +1621,7 @@
int delay = settings->gif_delay, trans = -1;//, disposal = 0;
- if (!(giffy = DGifOpenFileName(file_name))) return (-1);
+ if (!(giffy = DGifOpenFileName(file_name, NULL))) return (-1);
/* Get global palette */
settings->colors = convert_gif_palette(settings->pal, giffy->SColorMap);
@@ -1659,7 +1659,7 @@
}
}
res = 1;
-fail: DGifCloseFile(giffy);
+fail: DGifCloseFile(giffy, NULL);
return (res);
}
@@ -1682,10 +1682,10 @@
nc |= nc >> 1; nc |= nc >> 2; nc |= nc >> 4;
nc += !nc + 1; // No less than 2 colors
- gif_map = MakeMapObject(nc, NULL);
+ gif_map = GifMakeMapObject(nc, NULL);
if (!gif_map) return -1;
- giffy = EGifOpenFileName(file_name, FALSE);
+ giffy = EGifOpenFileName(file_name, FALSE, NULL);
if (!giffy) goto fail0;
for (i = 0; i < settings->colors; i++)
@@ -1725,14 +1725,14 @@
if (!settings->silent) progress_end();
msg = 0;
-fail: EGifCloseFile(giffy);
+fail: EGifCloseFile(giffy, NULL);
#ifndef WIN32
/* giflib creates files with 0600 permissions, which is nasty - WJ */
mode = umask(0022);
umask(mode);
chmod(file_name, 0666 & ~mode);
#endif
-fail0: FreeMapObject(gif_map);
+fail0: GifFreeMapObject(gif_map);
return (msg);
}