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:
10
wrlib/gif.c
10
wrlib/gif.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user