Module Name:    xsrc
Committed By:   mrg
Date:           Thu Jan 19 05:18:00 UTC 2023

Modified Files:
        xsrc/external/mit/libXpm/dist/src: create.c

Log Message:
merge libXpm 3.5.15.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXpm/dist/src/create.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libXpm/dist/src/create.c
diff -u xsrc/external/mit/libXpm/dist/src/create.c:1.4 xsrc/external/mit/libXpm/dist/src/create.c:1.5
--- xsrc/external/mit/libXpm/dist/src/create.c:1.4	Sun Jan  8 06:03:45 2023
+++ xsrc/external/mit/libXpm/dist/src/create.c	Thu Jan 19 05:18:00 2023
@@ -994,11 +994,15 @@ CreateXImage(
 #if !defined(FOR_MSW) && !defined(AMIGA)
     if (height != 0 && (*image_return)->bytes_per_line >= INT_MAX / height) {
 	XDestroyImage(*image_return);
+	*image_return = NULL;
 	return XpmNoMemory;
     }
     /* now that bytes_per_line must have been set properly alloc data */
-    if((*image_return)->bytes_per_line == 0 ||  height == 0)
+    if((*image_return)->bytes_per_line == 0 ||  height == 0) {
+	XDestroyImage(*image_return);
+	*image_return = NULL;
     	return XpmNoMemory;
+    }
     (*image_return)->data =
 	(char *) XpmMalloc((*image_return)->bytes_per_line * height);
 

Reply via email to