summaryrefslogtreecommitdiff
path: root/extra/openjpeg/openjpeg-1.5-r2032.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/openjpeg/openjpeg-1.5-r2032.patch')
-rw-r--r--extra/openjpeg/openjpeg-1.5-r2032.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/extra/openjpeg/openjpeg-1.5-r2032.patch b/extra/openjpeg/openjpeg-1.5-r2032.patch
new file mode 100644
index 000000000..3d7d4fa7c
--- /dev/null
+++ b/extra/openjpeg/openjpeg-1.5-r2032.patch
@@ -0,0 +1,30 @@
+Index: libopenjpeg/j2k.c
+===================================================================
+--- libopenjpeg/j2k.c (revision 2031)
++++ libopenjpeg/j2k.c (revision 2032)
+@@ -468,6 +468,12 @@
+ }
+ #endif /* USE_JPWL */
+
++ /* prevent division by zero */
++ if (!(cp->tdx * cp->tdy)) {
++ opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid tile size (tdx: %d, tdy: %d)\n", cp->tdx, cp->tdy);
++ return;
++ }
++
+ image->comps = (opj_image_comp_t*) opj_calloc(image->numcomps, sizeof(opj_image_comp_t));
+ for (i = 0; i < image->numcomps; i++) {
+ int tmp, w, h;
+@@ -506,6 +512,12 @@
+ }
+ #endif /* USE_JPWL */
+
++ /* prevent division by zero */
++ if (!(image->comps[i].dx * image->comps[i].dy)) {
++ opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid component size (dx: %d, dy: %d)\n", image->comps[i].dx, image->comps[i].dy);
++ return;
++ }
++
+ /* TODO: unused ? */
+ w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx);
+ h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy);