Bug 726586 - Uninitialised value use in build_input_gamma_table. r=jrmuizel
authorJulian Seward <jseward@acm.org>, Benoit Girard <bgirard@mozilla.com>
Mon, 10 Dec 2012 11:10:26 -0500
changeset 115533 86e10b84313b6eb4080f1ffc129787d4f5591952
parent 115532 cd99d7db5a7bf74bbca1996d1a8453663ee039a0
child 115534 25e87c4b7645b7272f386a28e8ea949820edf196
push id24015
push useremorley@mozilla.com
push dateTue, 11 Dec 2012 15:51:15 +0000
treeherdermozilla-central@87f8165c5a0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs726586
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 726586 - Uninitialised value use in build_input_gamma_table. r=jrmuizel
gfx/qcms/iccread.c
--- a/gfx/qcms/iccread.c
+++ b/gfx/qcms/iccread.c
@@ -421,17 +421,17 @@ static struct curveType *read_curveType(
 			invalid_source(src, "curve size too large");
 			return NULL;
 		}
 		curve = malloc(sizeof(struct curveType) + sizeof(uInt16Number)*count);
 		if (!curve)
 			return NULL;
 
 		curve->count = count;
-		curve->type = type;
+		curve->type = CURVE_TYPE;
 
 		for (i=0; i<count; i++) {
 			curve->data[i] = read_u16(src, offset + 12 + i*2);
 		}
 		*len = 12 + count * 2;
 	} else { //PARAMETRIC_CURVE_TYPE
 		count = read_u16(src, offset+8);
 
@@ -440,17 +440,17 @@ static struct curveType *read_curveType(
 			return NULL;
 		}
 
 		curve = malloc(sizeof(struct curveType));
 		if (!curve)
 			return NULL;
 
 		curve->count = count;
-		curve->type = type;
+		curve->type = PARAMETRIC_CURVE_TYPE;
 
 		for (i=0; i < COUNT_TO_LENGTH[count]; i++) {
 			curve->parameter[i] = s15Fixed16Number_to_float(read_s15Fixed16Number(src, offset + 12 + i*4));	
 		}
 		*len = 12 + COUNT_TO_LENGTH[count] * 4;
 
 		if ((count == 1 || count == 2)) {
 			/* we have a type 1 or type 2 function that has a division by 'a' */
@@ -843,16 +843,17 @@ static struct curveType *curve_from_gamm
 {
 	struct curveType *curve;
 	int num_entries = 1;
 	curve = malloc(sizeof(struct curveType) + sizeof(uInt16Number)*num_entries);
 	if (!curve)
 		return NULL;
 	curve->count = num_entries;
 	curve->data[0] = float_to_u8Fixed8Number(gamma);
+  curve->type = CURVE_TYPE;
 	return curve;
 }
 
 
 //XXX: it would be nice if we had a way of ensuring
 // everything in a profile was initialized regardless of how it was created
 
 //XXX: should this also be taking a black_point?