summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gdimageline/gdimageline_bug5.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/gdimageline/gdimageline_bug5.c b/tests/gdimageline/gdimageline_bug5.c
index 44adc8e..d055b0c 100644
--- a/tests/gdimageline/gdimageline_bug5.c
+++ b/tests/gdimageline/gdimageline_bug5.c
@@ -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);