This doesn't seem correct to me. 'profile', by being a parameter to this function, operates as a local variable. Setting it here to icc_profile_parameter->data() only has a local effect. I don't see any way that this function returns to the caller the actual ICC profile -- it neither makes a copy, nor does it return a pointer to the data in the ImageIOParameter that is found.