Permalink
Browse files

fix possible NULL deref

  • Loading branch information...
1 parent 4d4adf4 commit 88b3cdc4e9ec199044dd9b2d82d12639226091dd @pierrejoye pierrejoye committed Apr 9, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 ext/gd/libgd/gd_rotate.c
@@ -216,12 +216,13 @@ gdImagePtr gdImageRotate90 (gdImagePtr src, int ignoretransparent)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor(src->sy, src->sx);
- dst->transparent = src->transparent;
if (dst != NULL) {
int old_blendmode = dst->alphaBlendingFlag;
dst->alphaBlendingFlag = 0;
+ dst->transparent = src->transparent;
+
gdImagePaletteCopy (dst, src);
for (uY = 0; uY<src->sy; uY++) {
@@ -310,12 +311,13 @@ gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor (src->sy, src->sx);
- dst->transparent = src->transparent;
if (dst != NULL) {
int old_blendmode = dst->alphaBlendingFlag;
dst->alphaBlendingFlag = 0;
+ dst->transparent = src->transparent;
+
gdImagePaletteCopy (dst, src);
for (uY = 0; uY<src->sy; uY++) {

0 comments on commit 88b3cdc

Please sign in to comment.