File jasper-CVE-2016-9591.patch of Package jasper.18194

--- jasper-1.900.14/src/libjasper/jpc/jpc_enc.c	2016-10-26 08:57:31.000000000 +0200
+++ jasper-1.900.14/src/libjasper/jpc/jpc_enc.c	2016-12-21 09:13:46.503347680 +0100
@@ -2027,14 +2027,18 @@
 			tcmpt_destroy(tcmpt);
 		}
 		jas_free(tile->tcmpts);
+		tile->tcmpts = NULL;
 	}
 	if (tile->lyrsizes) {
 		jas_free(tile->lyrsizes);
+		tile->lyrsizes = NULL;
 	}
 	if (tile->pi) {
 		jpc_pi_destroy(tile->pi);
+		tile->pi = NULL;
 	}
 	jas_free(tile);
+	tile = NULL;
 }
 
 static jpc_enc_tcmpt_t *tcmpt_create(jpc_enc_tcmpt_t *tcmpt, jpc_enc_cp_t *cp,
@@ -2143,13 +2147,16 @@
 			rlvl_destroy(rlvl);
 		}
 		jas_free(tcmpt->rlvls);
+		tcmpt->rlvls = NULL;
 	}
 
 	if (tcmpt->data) {
 		jas_seq2d_destroy(tcmpt->data);
+		tcmpt->data = NULL;
 	}
 	if (tcmpt->tsfb) {
 		jpc_tsfb_destroy(tcmpt->tsfb);
+		tcmpt->tsfb = NULL;
 	}
 }
 
@@ -2245,6 +2252,7 @@
 			band_destroy(band);
 		}
 		jas_free(rlvl->bands);
+		rlvl->bands = NULL;
 	}
 }
 
@@ -2328,9 +2336,11 @@
 			prc_destroy(prc);
 		}
 		jas_free(band->prcs);
+		band->prcs = NULL;
 	}
 	if (band->data) {
 		jas_seq2d_destroy(band->data);
+		band->data = NULL;
 	}
 }
 
@@ -2470,18 +2480,23 @@
 			cblk_destroy(cblk);
 		}
 		jas_free(prc->cblks);
+		prc->cblks = NULL;
 	}
 	if (prc->incltree) {
 		jpc_tagtree_destroy(prc->incltree);
+		prc->incltree = NULL;
 	}
 	if (prc->nlibtree) {
 		jpc_tagtree_destroy(prc->nlibtree);
+		prc->nlibtree = NULL;
 	}
 	if (prc->savincltree) {
 		jpc_tagtree_destroy(prc->savincltree);
+		prc->savincltree = NULL;
 	}
 	if (prc->savnlibtree) {
 		jpc_tagtree_destroy(prc->savnlibtree);
+		prc->savnlibtree = NULL;
 	}
 }
 
@@ -2553,18 +2568,23 @@
 			pass_destroy(pass);
 		}
 		jas_free(cblk->passes);
+		cblk->passes = NULL;
 	}
 	if (cblk->stream) {
 		jas_stream_close(cblk->stream);
+		cblk->stream = NULL;
 	}
 	if (cblk->mqenc) {
 		jpc_mqenc_destroy(cblk->mqenc);
+		cblk->mqenc = NULL;
 	}
 	if (cblk->data) {
 		jas_seq2d_destroy(cblk->data);
+		cblk->data = NULL;
 	}
 	if (cblk->flags) {
 		jas_seq2d_destroy(cblk->flags);
+		cblk->flags = NULL;
 	}
 }
openSUSE Build Service is sponsored by