Blame SOURCES/jasper-CVE-2014-8137.patch

f6e2e8
--- jasper-1.900.1.orig/src/libjasper/base/jas_icc.c	2014-12-11 14:06:44.000000000 +0100
f6e2e8
+++ jasper-1.900.1/src/libjasper/base/jas_icc.c	2014-12-11 15:16:37.971272386 +0100
f6e2e8
@@ -1009,7 +1009,6 @@ static int jas_icccurv_input(jas_iccattr
f6e2e8
 	return 0;
f6e2e8
 
f6e2e8
 error:
f6e2e8
-	jas_icccurv_destroy(attrval);
f6e2e8
 	return -1;
f6e2e8
 }
f6e2e8
 
f6e2e8
@@ -1127,7 +1126,6 @@ static int jas_icctxtdesc_input(jas_icca
f6e2e8
 #endif
f6e2e8
 	return 0;
f6e2e8
 error:
f6e2e8
-	jas_icctxtdesc_destroy(attrval);
f6e2e8
 	return -1;
f6e2e8
 }
f6e2e8
 
f6e2e8
@@ -1206,8 +1204,6 @@ static int jas_icctxt_input(jas_iccattrv
f6e2e8
 		goto error;
f6e2e8
 	return 0;
f6e2e8
 error:
f6e2e8
-	if (txt->string)
f6e2e8
-		jas_free(txt->string);
f6e2e8
 	return -1;
f6e2e8
 }
f6e2e8
 
f6e2e8
@@ -1328,7 +1324,6 @@ static int jas_icclut8_input(jas_iccattr
f6e2e8
 		goto error;
f6e2e8
 	return 0;
f6e2e8
 error:
f6e2e8
-	jas_icclut8_destroy(attrval);
f6e2e8
 	return -1;
f6e2e8
 }
f6e2e8
 
f6e2e8
@@ -1497,7 +1492,6 @@ static int jas_icclut16_input(jas_iccatt
f6e2e8
 		goto error;
f6e2e8
 	return 0;
f6e2e8
 error:
f6e2e8
-	jas_icclut16_destroy(attrval);
f6e2e8
 	return -1;
f6e2e8
 }
f6e2e8
 
f6e2e8
--- jasper-1.900.1.orig/src/libjasper/jp2/jp2_dec.c	2014-12-11 14:30:54.193209780 +0100
f6e2e8
+++ jasper-1.900.1/src/libjasper/jp2/jp2_dec.c	2014-12-11 14:36:46.313217814 +0100
f6e2e8
@@ -291,7 +291,10 @@ jas_image_t *jp2_decode(jas_stream_t *in
f6e2e8
 	case JP2_COLR_ICC:
f6e2e8
 		iccprof = jas_iccprof_createfrombuf(dec->colr->data.colr.iccp,
f6e2e8
 		  dec->colr->data.colr.iccplen);
f6e2e8
-		assert(iccprof);
f6e2e8
+		if (!iccprof) {
f6e2e8
+			jas_eprintf("error: failed to parse ICC profile\n");
f6e2e8
+			goto error;
f6e2e8
+		}
f6e2e8
 		jas_iccprof_gethdr(iccprof, &icchdr);
f6e2e8
 		jas_eprintf("ICC Profile CS %08x\n", icchdr.colorspc);
f6e2e8
 		jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));