Commits

tabe  committed 02ae7c2

check whether a new image is null or not.

  • Participants
  • Parent commits 1abc30e

Comments (0)

Files changed (2)

File src/gd_crop.c

 	gdImagePtr dst;
 
 	dst = gdImageCreateTrueColor(crop->width, crop->height);
+	if (!dst) return NULL;
 	gdImageCopy(dst, src, 0, 0, crop->x, crop->y, crop->width, crop->height);
 
 	return dst;

File src/gd_tiff.c

 	if (!force_rgba && 
 			(image_type == GD_PALETTE || image_type == GD_INDEXED || image_type == GD_GRAY)) {
 		im = gdImageCreate(width, height);
+		if (!im) goto error;
 		readTiffColorMap(im, tif, is_bw, photometric);
 	} else {
 		im = gdImageCreateTrueColor(width, height);
+		if (!im) goto error;
 	}
 
 #ifdef DEBUG