From ef01f18dfc6780b776d0674ed3e7415c6ef54d24 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Thu, 8 Sep 2016 07:34:46 +0200 Subject: [PATCH 1/5] Cast to size_t before multiplication Need to cast to size_t before multiplication otherwise overflow check is useless. --- src/lib/openjp2/pi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c index 36e2ff0c..809b33d7 100644 --- a/src/lib/openjp2/pi.c +++ b/src/lib/openjp2/pi.c @@ -1241,7 +1241,7 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, l_current_pi->include = 00; if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U))) { - l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); + l_current_pi->include = (OPJ_INT16*) opj_calloc((size_t)(l_tcp->numlayers + 1U) * l_step_l, sizeof(OPJ_INT16)); } if From 5fb81d986e84074b576192541621a29fcdf8b0f8 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Thu, 8 Sep 2016 11:28:58 +0200 Subject: [PATCH 2/5] Update THANKS.md --- THANKS.md | 63 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/THANKS.md b/THANKS.md index dac61019..8e93d590 100644 --- a/THANKS.md +++ b/THANKS.md @@ -4,34 +4,35 @@ Many people have contributed to OpenJPEG by reporting problems, suggesting vario or submitting actual code. Here is a list of these people. Help me keep it complete and exempt of errors. -Giuseppe Baruffa -Ben Boeckel -Aaron Boxer -David Burken -Matthieu Darbois -Rex Dieter -Herve Drolon -Antonin Descampe -Francois-Olivier Devaux -Parvatha Elangovan -Jerôme Fimes -Bob Friesenhahn -Kaori Hagihara -Luc Hermitte -Luis Ibanez -David Janssens -Hans Johnson -Callum Lerwick -Sebastien Lugan -Benoit Macq -Mathieu Malaterre -Julien Malik -Arnaud Maye -Vincent Nicolas -Glenn Pearson -Even Rouault -Dzonatas Sol -Winfried Szukalski -Vincent Torri -Yannick Verschueren -Peter Wimmer +* Giuseppe Baruffa +* Ben Boeckel +* Aaron Boxer +* David Burken +* Matthieu Darbois +* Rex Dieter +* Herve Drolon +* Antonin Descampe +* Francois-Olivier Devaux +* Parvatha Elangovan +* Jerôme Fimes +* Bob Friesenhahn +* Kaori Hagihara +* Luc Hermitte +* Luis Ibanez +* David Janssens +* Hans Johnson +* Callum Lerwick +* Ke Liu (Tencent's Xuanwu LAB) +* Sebastien Lugan +* Benoit Macq +* Mathieu Malaterre +* Julien Malik +* Arnaud Maye +* Vincent Nicolas +* Glenn Pearson +* Even Rouault +* Dzonatas Sol +* Winfried Szukalski +* Vincent Torri +* Yannick Verschueren +* Peter Wimmer From b21a8317e5cba895aaca066330fe1dca15371eab Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Thu, 8 Sep 2016 22:14:19 +0200 Subject: [PATCH 3/5] Fix coverity 113065 (CWE-484) (#824) --- src/lib/openjp2/t1_generate_luts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/openjp2/t1_generate_luts.c b/src/lib/openjp2/t1_generate_luts.c index cba7245d..f9aaa39c 100644 --- a/src/lib/openjp2/t1_generate_luts.c +++ b/src/lib/openjp2/t1_generate_luts.c @@ -52,6 +52,7 @@ static int t1_init_ctxno_zc(int f, int orient) { t = h; h = v; v = t; + /* fall through */ case 0: case 1: if (!h) { From 45ed017b1b9cfac6578d40a2ccc33640c2a94f78 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Thu, 8 Sep 2016 23:56:06 +0200 Subject: [PATCH 4/5] Add test for issue 826 (#827) Update uclouvain/openjpeg#826 Also correct names for data of issue uclouvain/openjpeg#823 --- tests/nonregression/test_suite.ctest.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index 2dfabfbc..1fb4364f 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -566,6 +566,7 @@ opj_decompress -i @INPUT_NR_PATH@/issue726.j2k -o @TEMP_PATH@/issue726.png !opj_decompress -i @INPUT_NR_PATH@/issue775-2.j2k -o @TEMP_PATH@/issue775-2.png # issue 818 opj_decompress -i @INPUT_NR_PATH@/issue818.jp2 -o @TEMP_PATH@/issue818.png -# issue 823 (yes, not a typo, test image is issue822) -!opj_decompress -i @INPUT_NR_PATH@/issue822.jp2 -o @TEMP_PATH@/issue822.png - +# issue 823 +!opj_decompress -i @INPUT_NR_PATH@/issue823.jp2 -o @TEMP_PATH@/issue823.png +# issue 826 +!opj_decompress -i @INPUT_NR_PATH@/issue826.jp2 -o @TEMP_PATH@/issue826.png From 805972f4c85fd4b34e08e499c12c68334706df47 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Sun, 11 Sep 2016 19:47:32 +0200 Subject: [PATCH 5/5] Add test for issue 820 (#829) Update uclouvain/openjpeg#820 --- tests/nonregression/CMakeLists.txt | 1 + tests/nonregression/test_suite.ctest.in | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index 53cdc9f4..187c1cb0 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -51,6 +51,7 @@ set(BLACKLIST_JPEG2000_TMP issue427-null-image-size.jp2 issue427-illegal-tile-offset.jp2 issue495.jp2 + issue820.jp2 ) # Define a list of file which should be gracefully rejected: diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index 1fb4364f..bd22c91f 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -570,3 +570,5 @@ opj_decompress -i @INPUT_NR_PATH@/issue818.jp2 -o @TEMP_PATH@/issue818.png !opj_decompress -i @INPUT_NR_PATH@/issue823.jp2 -o @TEMP_PATH@/issue823.png # issue 826 !opj_decompress -i @INPUT_NR_PATH@/issue826.jp2 -o @TEMP_PATH@/issue826.png +# issue 820 +!opj_decompress -i @INPUT_NR_PATH@/issue820.jp2 -o @TEMP_PATH@/issue820.png