summaryrefslogtreecommitdiff
path: root/graphics/jasper/files/patch-jpc_t2enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/jasper/files/patch-jpc_t2enc.c')
-rw-r--r--graphics/jasper/files/patch-jpc_t2enc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/graphics/jasper/files/patch-jpc_t2enc.c b/graphics/jasper/files/patch-jpc_t2enc.c
new file mode 100644
index 000000000000..9f8e31c67f1d
--- /dev/null
+++ b/graphics/jasper/files/patch-jpc_t2enc.c
@@ -0,0 +1,29 @@
+--- src/libjasper/jpc/jpc_t2enc.c.orig 2007-01-19 22:43:07.000000000 +0100
++++ src/libjasper/jpc/jpc_t2enc.c 2013-04-17 22:32:23.000000000 +0200
+@@ -565,7 +565,7 @@
+ }
+ pi->pktno = -1;
+ pi->numcomps = cp->numcmpts;
+- if (!(pi->picomps = jas_malloc(pi->numcomps * sizeof(jpc_picomp_t)))) {
++ if (!(pi->picomps = jas_malloc2(pi->numcomps, sizeof(jpc_picomp_t)))) {
+ jpc_pi_destroy(pi);
+ return 0;
+ }
+@@ -577,7 +577,7 @@
+ for (compno = 0, tcomp = tile->tcmpts, picomp = pi->picomps;
+ compno < pi->numcomps; ++compno, ++tcomp, ++picomp) {
+ picomp->numrlvls = tcomp->numrlvls;
+- if (!(picomp->pirlvls = jas_malloc(picomp->numrlvls *
++ if (!(picomp->pirlvls = jas_malloc2(picomp->numrlvls,
+ sizeof(jpc_pirlvl_t)))) {
+ jpc_pi_destroy(pi);
+ return 0;
+@@ -591,7 +591,7 @@
+ /* XXX sizeof(long) should be sizeof different type */
+ pirlvl->numprcs = rlvl->numprcs;
+ if (rlvl->numprcs) {
+- if (!(pirlvl->prclyrnos = jas_malloc(pirlvl->numprcs *
++ if (!(pirlvl->prclyrnos = jas_malloc2(pirlvl->numprcs,
+ sizeof(long)))) {
+ jpc_pi_destroy(pi);
+ return 0;