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.
--- a/gfx/qcms/iccread.c
+++ b/gfx/qcms/iccread.c
@@ -222,16 +222,20 @@ static struct tag_index read_tag_table(q
// ignored.
qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
{
float sum[3], target[3], tolerance[3];
float rX, rY, rZ, gX, gY, gZ, bX, bY, bZ;
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);
gX = s15Fixed16Number_to_float(profile->greenColorant.X);
gY = s15Fixed16Number_to_float(profile->greenColorant.Y);
gZ = s15Fixed16Number_to_float(profile->greenColorant.Z);