From 5f01b80d83526d4f8e112b7ca45ece6807654e4e Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 2 Jul 2009 11:34:08 -0400 Subject: [PATCH] Bug 498245. Check that the profile is an RGB profile before checking if it's bogus. r=bholley This avoids unitialized reads on non-RGB profiles. --- gfx/qcms/iccread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/qcms/iccread.c b/gfx/qcms/iccread.c index c11726d4cd40..93560ecc2bd0 100644 --- a/gfx/qcms/iccread.c +++ b/gfx/qcms/iccread.c @@ -227,6 +227,10 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile) bool negative; unsigned i; + // We currently only check the bogosity of RGB profiles + if (profile->color_space != RGB_SIGNATURE) + return false; + rX = s15Fixed16Number_to_float(profile->redColorant.X); rY = s15Fixed16Number_to_float(profile->redColorant.Y); rZ = s15Fixed16Number_to_float(profile->redColorant.Z);