mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- fix for 0 sized gif images too
- fixed wrong test for 0 size in nxpm.c
This commit is contained in:
@@ -23,7 +23,7 @@ Changes since version 0.80.1:
|
||||
- Added kinput2 bug workaround in stock WMWindowAttributes (Seiichi SATO
|
||||
<sato@cvs-net.co.jp>)
|
||||
- Added Belarusian translation (Ihar Viarheichyk <iverg@mail.ru>)
|
||||
- Fixed wrlib to not try to load braindead images with 0x0 size
|
||||
- Fixed wrlib not to load braindead images with 0 sized width or height
|
||||
- Removed double no-position-display when cycling position display types
|
||||
with Shift key while moving windows.
|
||||
- Changed the default position display while moving a window to 'Center'.
|
||||
|
||||
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);
|
||||
|
||||
@@ -86,9 +86,9 @@ RGetImageFromXPMData(RContext *context, char **data)
|
||||
int w, h, ccount, csize;
|
||||
|
||||
if (sscanf(data[line++], "%i %i %i %i", &w, &h, &ccount, &csize)!=4
|
||||
|| w <= 1 || h <= 1 || ccount <= 0 || csize <= 0)
|
||||
|| w <= 0 || h <= 0 || ccount <= 0 || csize <= 0)
|
||||
goto bad_format;
|
||||
|
||||
|
||||
if (csize!=1 && csize!=2)
|
||||
goto bad_format;
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ RLoadTIFF(RContext *context, char *file, int index)
|
||||
TIFFClose(tif);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* read data */
|
||||
ptr = data = (uint32*)_TIFFmalloc(width * height * sizeof(uint32));
|
||||
|
||||
|
||||
if (!data) {
|
||||
RErrorCode = RERR_NOMEMORY;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user