summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-18 10:21:11 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-18 10:21:11 +0000
commit79d18f7fd09d26f57c8ed5cbaac9e684a947630f (patch)
treef9d973d609341f71552964e63f23913c9bf5cc82
parent99d1859a44f1200c03ae0453190c46f9c99440ec (diff)
[trunk] Now that dataset from issue 297 have been imported, run test suite.
None of the dataset triggered any buffer overflow. Recent changes in trunk handle all those cases. Update issue 297
-rw-r--r--src/lib/openjp2/j2k.c6
-rw-r--r--tests/nonregression/CMakeLists.txt16
-rw-r--r--tests/nonregression/test_suite.ctest.in17
3 files changed, 36 insertions, 3 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index 4434bf11..e03db41d 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -1983,7 +1983,7 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
/* testcase 1610.pdf.SIGSEGV.59c.681 */
if (((OPJ_UINT64)l_image->x1) * ((OPJ_UINT64)l_image->y1) != (l_image->x1 * l_image->y1)) {
- opj_event_msg(p_manager, EVT_ERROR, "Prevent buffer overflow (x1: %d, y1: %d)", l_image->x1, l_image->y1);
+ opj_event_msg(p_manager, EVT_ERROR, "Prevent buffer overflow (x1: %d, y1: %d)\n", l_image->x1, l_image->y1);
return OPJ_FALSE;
}
@@ -3568,7 +3568,7 @@ OPJ_BOOL j2k_read_ppm_v3 (
l_cp->ppm_data = NULL;
l_cp->ppm_buffer = NULL;
l_cp->ppm = 0; /* do not use PPM */
- return OPJ_TRUE;
+ return OPJ_FALSE;
}
/* First PPM marker: Initialization */
@@ -3613,7 +3613,7 @@ OPJ_BOOL j2k_read_ppm_v3 (
l_cp->ppm_data = NULL;
l_cp->ppm_buffer = NULL;
l_cp->ppm = 0; /* do not use PPM */
- return OPJ_TRUE;
+ return OPJ_FALSE;
}
/* Increase the size of ppm_data to add the new Ippm series*/
assert(l_cp->ppm_data == l_cp->ppm_buffer && "We need ppm_data and ppm_buffer to be the same when reallocating");
diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt
index a46842be..ee5209e3 100644
--- a/tests/nonregression/CMakeLists.txt
+++ b/tests/nonregression/CMakeLists.txt
@@ -26,6 +26,22 @@ set(BLACKLIST_JPEG2000_TMP
4035.pdf.SIGSEGV.d8b.3375.jp2
3635.pdf.asan.77.2930.jp2
issue165.jp2
+ #edf_c2_1103421.jp2
+ edf_c2_1178956.jp2
+ edf_c2_1000290.jp2
+ #edf_c2_1000691.jp2 # ok
+ #edf_c2_20.jp2 #looks ok as per kdu_jp2info
+ edf_c2_1377017.jp2
+ edf_c2_1002767.jp2
+ #edf_c2_10025.jp2
+ edf_c2_1000234.jp2
+ edf_c2_225881.jp2
+ edf_c2_1000671.jp2
+ #edf_c2_1013627.jp2 # weird box, but kdu_jp2info ok
+ edf_c2_1015644.jp2
+ edf_c2_101463.jp2
+ edf_c2_1674177.jp2
+ edf_c2_1673169.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 2f856819..5c5c5091 100644
--- a/tests/nonregression/test_suite.ctest.in
+++ b/tests/nonregression/test_suite.ctest.in
@@ -148,6 +148,23 @@ opj_decompress -i @INPUT_NR_PATH@/issue171.jp2 -o @TEMP_PATH@/i
!opj_decompress -i @INPUT_NR_PATH@/broken.jpc -o @TEMP_PATH@/broken.jpc.pgx
# issue 226
opj_decompress -i @INPUT_NR_PATH@/issue226.j2k -o @TEMP_PATH@/issue226.j2k.pgx
+# issue 297
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1103421.jp2 -o @TEMP_PATH@/edf_c2_1103421.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1178956.jp2 -o @TEMP_PATH@/edf_c2_1178956.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1000290.jp2 -o @TEMP_PATH@/edf_c2_1000290.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1000691.jp2 -o @TEMP_PATH@/edf_c2_1000691.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_20.jp2 -o @TEMP_PATH@/edf_c2_20.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1377017.jp2 -o @TEMP_PATH@/edf_c2_1377017.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1002767.jp2 -o @TEMP_PATH@/edf_c2_1002767.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_10025.jp2 -o @TEMP_PATH@/edf_c2_10025.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1000234.jp2 -o @TEMP_PATH@/edf_c2_1000234.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_225881.jp2 -o @TEMP_PATH@/edf_c2_225881.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1000671.jp2 -o @TEMP_PATH@/edf_c2_1000671.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1013627.jp2 -o @TEMP_PATH@/edf_c2_1013627.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1015644.jp2 -o @TEMP_PATH@/edf_c2_1015644.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_101463.jp2 -o @TEMP_PATH@/edf_c2_101463.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1674177.jp2 -o @TEMP_PATH@/edf_c2_1674177.jp2.pgx
+!opj_decompress -i @INPUT_NR_PATH@/edf_c2_1673169.jp2 -o @TEMP_PATH@/edf_c2_1673169.jp2.pgx
# decode with specific area
# prec=12; nb_c=1