Bug 635373

Summary: jasper Assertion failed: dec->numcomps == 3
Product: [openSUSE] openSUSE Distribution Reporter: Forgotten User CSGA97KGGE <forgotten_CSGA97KGGE>
Component: BasesystemAssignee: Fridrich Strba <fstrba>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: qantas94heavy, wl
Version: Leap 42.2   
Target Milestone: Leap 42.2   
Hardware: x86-64   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User CSGA97KGGE 2010-08-29 19:37:18 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 SUSE/3.6.8-0.1.1 Firefox/3.6.8

Well, it affects ImageMagicks and libicns when trying to convert some kind of images (in my case, .icns ones).

A fix already exist, and should be applied.

Fedora uses the following:
------------------------------------------------------------------
diff -urN jasper-1.900.1/src/libjasper/jpc/jpc_dec.c jasper-1.900.1-fix/src/libjasper/jpc/jpc_dec.c
--- jasper-1.900.1/src/libjasper/jpc/jpc_dec.c	2007-01-19 14:43:07.000000000 -0700
+++ jasper-1.900.1-fix/src/libjasper/jpc/jpc_dec.c	2008-03-06 16:51:12.000000000 -0700
@@ -1069,12 +1069,12 @@
 	/* Apply an inverse intercomponent transform if necessary. */
 	switch (tile->cp->mctid) {
 	case JPC_MCT_RCT:
-		assert(dec->numcomps == 3);
+		assert(dec->numcomps >= 3);
 		jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data,
 		  tile->tcomps[2].data);
 		break;
 	case JPC_MCT_ICT:
-		assert(dec->numcomps == 3);
+		assert(dec->numcomps >= 3);
 		jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data,
 		  tile->tcomps[2].data);
 		break;
---------------------------------------------------------------------------

Debian is slightly different, changing the offending line with:
+		assert(dec->numcomps == 3 || dec->numcomps == 4);

After applying the patches, both convert tools seems to work fine, ImageMagick's convert and libicns's icns2png.

Regards,
André

PS.: libicns needs a little patch to be build against libpng >= 1.4.x since it uses a function that was deprecated.


Reproducible: Always

Steps to Reproduce:
1. Try to convert big icns files, it will not convert the big ones (>= 256x256)
2.
3.
Actual Results:  
Fail on big icns convertion.

Expected Results:  
Should convert fine.
Comment 1 Tomáš Chvátal 2017-08-11 13:51:24 UTC
Reassign for review.
Comment 2 Karl Cheng 2017-08-13 06:07:14 UTC
*** Bug 764267 has been marked as a duplicate of this bug. ***
Comment 3 Karl Cheng 2017-08-13 06:08:36 UTC
Appears to be fixed in Leap 42.3 with upstream package update, but still present in Leap 42.2.
Comment 4 Karl Cheng 2017-09-23 01:51:49 UTC
Fixed in 42.2 with update to 1.900.14.