[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
This commit is contained in:
Mathieu Malaterre 2014-03-18 10:21:11 +00:00
parent 99d1859a44
commit 79d18f7fd0
3 changed files with 36 additions and 3 deletions

View File

@ -1983,7 +1983,7 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
/* testcase 1610.pdf.SIGSEGV.59c.681 */ /* testcase 1610.pdf.SIGSEGV.59c.681 */
if (((OPJ_UINT64)l_image->x1) * ((OPJ_UINT64)l_image->y1) != (l_image->x1 * l_image->y1)) { 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; return OPJ_FALSE;
} }
@ -3568,7 +3568,7 @@ OPJ_BOOL j2k_read_ppm_v3 (
l_cp->ppm_data = NULL; l_cp->ppm_data = NULL;
l_cp->ppm_buffer = NULL; l_cp->ppm_buffer = NULL;
l_cp->ppm = 0; /* do not use PPM */ l_cp->ppm = 0; /* do not use PPM */
return OPJ_TRUE; return OPJ_FALSE;
} }
/* First PPM marker: Initialization */ /* First PPM marker: Initialization */
@ -3613,7 +3613,7 @@ OPJ_BOOL j2k_read_ppm_v3 (
l_cp->ppm_data = NULL; l_cp->ppm_data = NULL;
l_cp->ppm_buffer = NULL; l_cp->ppm_buffer = NULL;
l_cp->ppm = 0; /* do not use PPM */ 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*/ /* 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"); assert(l_cp->ppm_data == l_cp->ppm_buffer && "We need ppm_data and ppm_buffer to be the same when reallocating");

View File

@ -26,6 +26,22 @@ set(BLACKLIST_JPEG2000_TMP
4035.pdf.SIGSEGV.d8b.3375.jp2 4035.pdf.SIGSEGV.d8b.3375.jp2
3635.pdf.asan.77.2930.jp2 3635.pdf.asan.77.2930.jp2
issue165.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: # Define a list of file which should be gracefully rejected:

View File

@ -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 !opj_decompress -i @INPUT_NR_PATH@/broken.jpc -o @TEMP_PATH@/broken.jpc.pgx
# issue 226 # issue 226
opj_decompress -i @INPUT_NR_PATH@/issue226.j2k -o @TEMP_PATH@/issue226.j2k.pgx 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 # decode with specific area
# prec=12; nb_c=1 # prec=12; nb_c=1