CID: 1236 [@ cmsGetDeviceClass] Intent flag lost by cmsGetDeviceClass from CreateProof

RESOLVED WONTFIX

Status

()

Core
GFX: Color Management
--
critical
RESOLVED WONTFIX
10 years ago
15 days ago

People

(Reporter: timeless, Assigned: bholley)

Tracking

(Blocks: 1 bug, {coverity, crash})

Trunk
coverity, crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(crash signature, URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
Checker: FORWARD_NULL (help)
File: base/src/mozilla/modules/lcms/src/cmsxform.c
Function: CreateProof
Description: Variable "(p)->PreviewProfile" tracked as NULL was passed to a function that dereferences it.

562  	icProfileClassSignature LCMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile)
564  	       LPLCMSICCPROFILE  Icc = (LPLCMSICCPROFILE) hProfile;
Event deref_var: Dereference of local "Icc" that aliases parameter
565  	       return Icc -> DeviceClass;

--
1705 	LCMSBOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile,
1706 	                                                int Intent, int UsedDirection)
1709 	     icTagSignature* TagTable;
checking for 'Intent = 0' would avoid this crash
1713 	     if (cmsGetDeviceClass(hProfile) != icSigLinkClass) {

--
794  	LPLUT ComputeGamutWithInput(cmsHPROFILE hInput, cmsHPROFILE hProfile, int Intent)
816  	    if (!cmsIsIntentSupported(hProfile, Intent, LCMS_USED_AS_INPUT) &&

--
905  	LPLUT _cmsComputeGamutLUT(cmsHPROFILE hProfile, int Intent)
907  	    return ComputeGamutWithInput(NULL, hProfile, Intent);

--

1149 	void CreateProof(_LPcmsTRANSFORM p, icTagSignature *ToTagPtr)
1152 	    icTagSignature ProofTag;
1153 	   
1154 	    if (p -> dwOriginalFlags & cmsFLAGS_SOFTPROOFING) {
1159 	      p -> Preview = _cmsComputeSoftProofLUT(p ->PreviewProfile, p ->Intent); 
1162 	      // That's a proofing transfor, so use second intent for output.
I wouldn't cry if someone fixed the typo of 'transform' here...
1164 	      *ToTagPtr  = PCS2Device[p->ProofIntent];
1166 	      if (p -> Preview == NULL) {
1168 	        ProofTag = Preview[p -> Intent];
1170 	        if (!cmsIsTag(p ->PreviewProfile,  ProofTag)) {
1172 	            ProofTag = Preview[0];

1177 	        if (ProofTag) {
1183 	        else
Event assign_zero: Variable "(p)->PreviewProfile" assigned value 0.
1186 	             p ->PreviewProfile = NULL;

1197 	    if ((p -> dwOriginalFlags & cmsFLAGS_GAMUTCHECK) && (p -> dwOriginalFlags & cmsFLAGS_NOTPRECALC)) {
Event var_deref_model: Variable "(p)->PreviewProfile" tracked as NULL was passed to a function that dereferences it. [model]
1200 	             p -> Gamut = _cmsComputeGamutLUT(p->PreviewProfile, p ->Intent);
(Assignee)

Updated

10 years ago
Component: ImageLib → GFX: Color Management
QA Contact: imagelib → color-management
(Assignee)

Comment 1

10 years ago
Created attachment 352053 [details] [diff] [review]
fix

added a fix - flagging vlad for review
Attachment #352053 - Flags: review?(vladimir)
(Assignee)

Comment 2

10 years ago
FWIW - This code is never reached by mozilla because we call cmsCreateTransform only, which in turn calls cmsCreateProofingTransform with the Proofing Profile set to null. The offending code only gets called if the Proofing Profile is not null.

Fix is simple enough though - might as well land it.

Comment 3

9 years ago
what is the next step on this one?
(Assignee)

Comment 4

9 years ago
this bug is obsoleted by bug 481926 - what's the appropriate way to resolve?
modules/lcms/ is gone.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WONTFIX
Crash Signature: [@ cmsGetDeviceClass]
You need to log in before you can comment on or make changes to this bug.