tests/gdimageline/gdimageline_bug5: add im null judgement (#624)
gdImageCreate returns NULL in gdimageline_bug5.c on AIX, which make the judgement necessary in case of segment fault.master
parent
43df499f1f
commit
bc658270f5
|
@ -10,7 +10,13 @@ int main() {
|
|||
/* FILE *pngout; */
|
||||
int black, white;
|
||||
|
||||
/* If the data seg size is less than 195000,
|
||||
* gdImageCrateTrueColor will return NULL.
|
||||
* See https://github.com/libgd/libgd/issues/621 */
|
||||
im = gdImageCreateTrueColor(63318, 771);
|
||||
if (gdTestAssertMsg(im != NULL, "gdImageCreateTrueColor() returns NULL\n") == 0) {
|
||||
return gdNumFailures();
|
||||
}
|
||||
|
||||
/* Allocate the color white (red, green and blue all maximum). */
|
||||
white = gdImageColorAllocate(im, 255, 255, 255);
|
||||
|
|
Loading…
Reference in New Issue