From a31993883d59529a7fb8c625476b28b2a156746a Mon Sep 17 00:00:00 2001 From: Shashank Sabniveesu Date: Thu, 8 May 2014 20:43:37 -0400 Subject: [PATCH] Bug 692922 - Fix use of posix_memalign() avoiding typecasts. r=BenWa --- gfx/qcms/transform.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/qcms/transform.c b/gfx/qcms/transform.c index bc609a186c01..f7bade6e8c43 100644 --- a/gfx/qcms/transform.c +++ b/gfx/qcms/transform.c @@ -923,11 +923,16 @@ void precache_release(struct precache_output *p) } } -#ifdef HAS_POSIX_MEMALIGN +#ifdef HAVE_POSIX_MEMALIGN static qcms_transform *transform_alloc(void) { qcms_transform *t; - if (!posix_memalign(&t, 16, sizeof(*t))) { + + void *allocated_memory; + if (!posix_memalign(&allocated_memory, 16, sizeof(qcms_transform))) { + /* Doing a memset to initialise all bits to 'zero'*/ + memset(allocated_memory, 0, sizeof(qcms_transform)); + t = allocated_memory; return t; } else { return NULL;