summaryrefslogtreecommitdiff
path: root/src/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gd.c')
-rw-r--r--src/gd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gd.c b/src/gd.c
index d78504e..95aeabb 100644
--- a/src/gd.c
+++ b/src/gd.c
@@ -3831,12 +3831,12 @@ static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t
*/
BGD_DECLARE(void) gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels)
{
- if (im->style) {
- gdFree (im->style);
- }
if (overflow2(sizeof (int), noOfPixels)) {
return;
}
+ if (im->style) {
+ gdFree (im->style);
+ }
im->style = (int *) gdMalloc (sizeof (int) * noOfPixels);
if (!im->style) {
return;