diff options
-rw-r--r-- | pixman/pixman-bits-image.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 5a5a6905..3257af07 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -1043,21 +1043,19 @@ pixman_image_create_bits (pixman_format_code_t format, return_val_if_fail (bits == NULL || (rowstride_bytes % sizeof (uint32_t)) == 0, NULL); + image = _pixman_image_allocate (); + + if (!image) + return NULL; + if (!bits && width && height) { free_me = bits = create_bits (format, width, height, &rowstride_bytes); if (!bits) + { + free (image); return NULL; - } - - image = _pixman_image_allocate (); - - if (!image) - { - if (free_me) - free (free_me); - - return NULL; + } } image->type = BITS; |