jasper/jasper-2.0.12-CVE-2017-1000050.patch
2017-08-25 13:05:09 +02:00

16 lines
533 B
Diff

diff -urNp old/src/libjasper/jp2/jp2_enc.c new/src/libjasper/jp2/jp2_enc.c
--- old/src/libjasper/jp2/jp2_enc.c 2017-08-25 12:49:46.242889564 +0200
+++ new/src/libjasper/jp2/jp2_enc.c 2017-08-25 12:56:41.041654317 +0200
@@ -115,6 +115,11 @@ int jp2_encode(jas_image_t *image, jas_s
iccstream = 0;
iccprof = 0;
+ if (jas_image_numcmpts(image) < 1) {
+ jas_eprintf("image must have at least one component\n");
+ goto error;
+ }
+
allcmptssame = 1;
sgnd = jas_image_cmptsgnd(image, 0);
prec = jas_image_cmptprec(image, 0);