  	struct curveType *curve = NULL;
  	uint32_t type = read_u32(src, offset);
  	uint32_t count;
-@@ -484,19 +535,23 @@ static void read_nested_curveType(struct mem_source *src, struct curveType *(*cu
+@@ -484,19 +640,23 @@ static void read_nested_curveType(struct mem_source *src, struct curveType *(*cu
  	uint32_t channel_offset = 0;
  	int i;
  	for (i = 0; i < num_channels; i++) {

 	free(table);
 	return profile;
 }
@@ -997,6 +1055,9 @@ qcms_profile* qcms_profile_from_memory(const void *mem, size_t size)
 	source.size = size;
 	source.valid = true;
 

 	uint32_t clut_size;
 	size_t entry_size;
 	struct lutType *lut;
@@ -979,6 +1139,9 @@ qcms_profile* qcms_profile_sRGB(void)
 		return NO_MEM_PROFILE;
 
 	profile = qcms_profile_create_rgb_with_table(D65, Rec709Primaries, table, 1024);
