Blame SOURCES/jasper-1.900.1-Coverity-CHECKED_RETURN.patch

2c4e85
Error: CHECKED_RETURN
2c4e85
jpc/jpc_cs.c:924: check_return: Calling function "jpc_putuint16" without checking return value (as is done elsewhere 11 out of 13 times).
2c4e85
jpc/jpc_cs.c:924: unchecked_value: No check of the return value of "jpc_putuint16(out, qcc->compno)".
2c4e85
2c4e85
jpc/jpc_cs.c:1021: check_return: Calling function "jpc_putuint16" without checking return value (as is done elsewhere 11 out of 13 times).
2c4e85
jpc/jpc_cs.c:1021: unchecked_value: No check of the return value of "jpc_putuint16(out, compparms->stepsizes[i])".
2c4e85
2c4e85
jpc/jpc_cs.c:994: check_return: Calling function "jpc_getuint16" without checking return value (as is done elsewhere 14 out of 16 times).
2c4e85
jpc/jpc_cs.c:994: unchecked_value: No check of the return value of "jpc_getuint16(in, compparms->stepsizes + i)".
2c4e85
2c4e85
jpc/jpc_cs.c:905: check_return: Calling function "jpc_getuint16" without checking return value (as is done elsewhere 14 out of 16 times).
2c4e85
jpc/jpc_cs.c:905: unchecked_value: No check of the return value of "jpc_getuint16(in, &qcc->compno)".
2c4e85
2c4e85
jpc/jpc_cs.c:969: check_return: Calling function "jpc_getuint8" without checking return value (as is done elsewhere 17 out of 20 times).
2c4e85
jpc/jpc_cs.c:969: unchecked_value: No check of the return value of "jpc_getuint8(in, &tmp)".
2c4e85
2c4e85
jpc/jpc_cs.c:991: check_return: Calling function "jpc_getuint8" without checking return value (as is done elsewhere 17 out of 20 times).
2c4e85
jpc/jpc_cs.c:991: unchecked_value: No check of the return value of "jpc_getuint8(in, &tmp)".
2c4e85
2c4e85
jpc/jpc_cs.c:901: check_return: Calling function "jpc_getuint8" without checking return value (as is done elsewhere 17 out of 20 times).
2c4e85
jpc/jpc_cs.c:901: unchecked_value: No check of the return value of "jpc_getuint8(in, &tmp)".
2c4e85
2c4e85
jpc/jpc_t2enc.c:338: check_return: Calling function "jpc_putms" without checking return value (as is done elsewhere 12 out of 13 times).
2c4e85
jpc/jpc_t2enc.c:338: unchecked_value: No check of the return value of "jpc_putms(out, enc->cstate, ms)".
2c4e85
2c4e85
ras/ras_enc.c:245: check_return: Calling function "jas_image_readcmpt" without checking return value (as is done elsewhere 9 out of 10 times).
2c4e85
ras/ras_enc.c:245: unchecked_value: No check of the return value of "jas_image_readcmpt(image, cmpts[i], 0L, y, image->brx_ - image->tlx_, 1L, data[i])".
2c4e85
2c4e85
diff -up jasper-1.900.1/src/libjasper/jpc/jpc_cs.c.checked_return jasper-1.900.1/src/libjasper/jpc/jpc_cs.c
2c4e85
--- jasper-1.900.1/src/libjasper/jpc/jpc_cs.c.checked_return	2007-01-19 22:43:07.000000000 +0100
2c4e85
+++ jasper-1.900.1/src/libjasper/jpc/jpc_cs.c	2011-06-24 13:52:25.636551844 +0200
2c4e85
@@ -898,11 +898,15 @@ static int jpc_qcc_getparms(jpc_ms_t *ms
2c4e85
 	int len;
2c4e85
 	len = ms->len;
2c4e85
 	if (cstate->numcomps <= 256) {
2c4e85
-		jpc_getuint8(in, &tmp);
2c4e85
+		if (jpc_getuint8(in, &tmp)) {
2c4e85
+			return -1;
2c4e85
+		}
2c4e85
 		qcc->compno = tmp;
2c4e85
 		--len;
2c4e85
 	} else {
2c4e85
-		jpc_getuint16(in, &qcc->compno);
2c4e85
+		if (jpc_getuint16(in, &qcc->compno)) {
2c4e85
+			return -1;
2c4e85
+		}
2c4e85
 		len -= 2;
2c4e85
 	}
2c4e85
 	if (jpc_qcx_getcompparms(&qcc->compparms, cstate, in, len)) {
2c4e85
@@ -919,9 +923,13 @@ static int jpc_qcc_putparms(jpc_ms_t *ms
2c4e85
 {
2c4e85
 	jpc_qcc_t *qcc = &ms->parms.qcc;
2c4e85
 	if (cstate->numcomps <= 256) {
2c4e85
-		jpc_putuint8(out, qcc->compno);
2c4e85
+		if (jpc_putuint8(out, qcc->compno)) {
2c4e85
+			return -1;
2c4e85
+		}
2c4e85
 	} else {
2c4e85
-		jpc_putuint16(out, qcc->compno);
2c4e85
+		if (jpc_putuint16(out, qcc->compno)) {
2c4e85
+			return -1;
2c4e85
+		}
2c4e85
 	}
2c4e85
 	if (jpc_qcx_putcompparms(&qcc->compparms, cstate, out)) {
2c4e85
 		return -1;
2c4e85
@@ -966,7 +974,9 @@ static int jpc_qcx_getcompparms(jpc_qcxc
2c4e85
 	cstate = 0;
2c4e85
 
2c4e85
 	n = 0;
2c4e85
-	jpc_getuint8(in, &tmp);
2c4e85
+	if (jpc_getuint8(in, &tmp)) {
2c4e85
+		return -1;
2c4e85
+	}
2c4e85
 	++n;
2c4e85
 	compparms->qntsty = tmp & 0x1f;
2c4e85
 	compparms->numguard = (tmp >> 5) & 7;
2c4e85
@@ -988,10 +998,14 @@ static int jpc_qcx_getcompparms(jpc_qcxc
2c4e85
 		assert(compparms->stepsizes);
2c4e85
 		for (i = 0; i < compparms->numstepsizes; ++i) {
2c4e85
 			if (compparms->qntsty == JPC_QCX_NOQNT) {
2c4e85
-				jpc_getuint8(in, &tmp);
2c4e85
+				if (jpc_getuint8(in, &tmp)) {
2c4e85
+					return -1;
2c4e85
+				}
2c4e85
 				compparms->stepsizes[i] = JPC_QCX_EXPN(tmp >> 3);
2c4e85
 			} else {
2c4e85
-				jpc_getuint16(in, &compparms->stepsizes[i]);
2c4e85
+				if (jpc_getuint16(in, &compparms->stepsizes[i])) {
2c4e85
+					return -1;
2c4e85
+				}
2c4e85
 			}
2c4e85
 		}
2c4e85
 	} else {
2c4e85
@@ -1015,10 +1029,14 @@ static int jpc_qcx_putcompparms(jpc_qcxc
2c4e85
 	jpc_putuint8(out, ((compparms->numguard & 7) << 5) | compparms->qntsty);
2c4e85
 	for (i = 0; i < compparms->numstepsizes; ++i) {
2c4e85
 		if (compparms->qntsty == JPC_QCX_NOQNT) {
2c4e85
-			jpc_putuint8(out, JPC_QCX_GETEXPN(
2c4e85
-			  compparms->stepsizes[i]) << 3);
2c4e85
+			if (jpc_putuint8(out, JPC_QCX_GETEXPN(
2c4e85
+			  compparms->stepsizes[i]) << 3)) {
2c4e85
+				return -1;
2c4e85
+			}
2c4e85
 		} else {
2c4e85
-			jpc_putuint16(out, compparms->stepsizes[i]);
2c4e85
+			if (jpc_putuint16(out, compparms->stepsizes[i])) {
2c4e85
+				return -1;
2c4e85
+			}
2c4e85
 		}
2c4e85
 	}
2c4e85
 	return 0;
2c4e85
diff -up jasper-1.900.1/src/libjasper/jpc/jpc_t2enc.c.checked_return jasper-1.900.1/src/libjasper/jpc/jpc_t2enc.c
2c4e85
--- jasper-1.900.1/src/libjasper/jpc/jpc_t2enc.c.checked_return	2007-01-19 22:43:07.000000000 +0100
2c4e85
+++ jasper-1.900.1/src/libjasper/jpc/jpc_t2enc.c	2011-06-24 12:29:32.069578992 +0200
2c4e85
@@ -335,7 +335,9 @@ assert(jpc_firstone(datalen) < cblk->num
2c4e85
 		if (!(ms = jpc_ms_create(JPC_MS_EPH))) {
2c4e85
 			return -1;
2c4e85
 		}
2c4e85
-		jpc_putms(out, enc->cstate, ms);
2c4e85
+		if (jpc_putms(out, enc->cstate, ms)) {
2c4e85
+			return -1;
2c4e85
+		}
2c4e85
 		jpc_ms_destroy(ms);
2c4e85
 	}
2c4e85
 
2c4e85
diff -up jasper-1.900.1/src/libjasper/ras/ras_enc.c.checked_return jasper-1.900.1/src/libjasper/ras/ras_enc.c
2c4e85
--- jasper-1.900.1/src/libjasper/ras/ras_enc.c.checked_return	2007-01-19 22:43:04.000000000 +0100
2c4e85
+++ jasper-1.900.1/src/libjasper/ras/ras_enc.c	2011-06-24 14:05:31.233482612 +0200
2c4e85
@@ -242,8 +242,10 @@ static int ras_putdatastd(jas_stream_t *
2c4e85
 
2c4e85
 	for (y = 0; y < hdr->height; y++) {
2c4e85
 		for (i = 0; i < numcmpts; ++i) {
2c4e85
-			jas_image_readcmpt(image, cmpts[i], 0, y, jas_image_width(image),
2c4e85
-			  1, data[i]);
2c4e85
+			if (jas_image_readcmpt(image, cmpts[i], 0, y,
2c4e85
+					jas_image_width(image), 1, data[i])) {
2c4e85
+				return -1;
2c4e85
+			}
2c4e85
 		}
2c4e85
 		z = 0;
2c4e85
 		nz = 0;