1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-03 20:34:14 +01:00

- fix for 0 sized gif images too

- fixed wrong test for 0 size in nxpm.c
This commit is contained in:
dan
2002-10-25 04:21:09 +00:00
parent 0f0afc48ab
commit 3af4aa7846
4 changed files with 13 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ RLoadGIF(RContext *context, char *file, int index)
RErrorCode = RERR_BADINDEX;
gif = DGifOpenFileName(file);
if (!gif) {
switch (GifLastError()) {
case D_GIF_ERR_OPEN_FAILED:
@@ -78,6 +78,12 @@ RLoadGIF(RContext *context, char *file, int index)
return NULL;
}
if (gif->Image.Width<1 || gif->Image.Height<1) {
DGifCloseFile(gif);
RErrorCode = RERR_BADIMAGEFILE;
return NULL;
}
colormap = gif->SColorMap;
i = 0;
@@ -206,7 +212,7 @@ giferr:
default:
RErrorCode = RERR_BADIMAGEFILE;
break;
}
}
bye:
if (image)
RReleaseImage(image);