Merge pull request #1121 from rouault/fix_tnsot_zero
Fix regression in reading files with TNsot == 0 (refs #1120)
This commit is contained in:
commit
d2205ba2ee
|
@ -4094,7 +4094,12 @@ static OPJ_BOOL opj_j2k_merge_ppt(opj_tcp_t *p_tcp, opj_event_mgr_t * p_manager)
|
||||||
/* preconditions */
|
/* preconditions */
|
||||||
assert(p_tcp != 00);
|
assert(p_tcp != 00);
|
||||||
assert(p_manager != 00);
|
assert(p_manager != 00);
|
||||||
assert(p_tcp->ppt_buffer == NULL);
|
|
||||||
|
if (p_tcp->ppt_buffer != NULL) {
|
||||||
|
opj_event_msg(p_manager, EVT_ERROR,
|
||||||
|
"opj_j2k_merge_ppt() has already been called\n");
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (p_tcp->ppt == 0U) {
|
if (p_tcp->ppt == 0U) {
|
||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
|
@ -8845,7 +8850,10 @@ OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t * p_j2k,
|
||||||
|
|
||||||
/* Current marker is the EOC marker ?*/
|
/* Current marker is the EOC marker ?*/
|
||||||
if (l_current_marker == J2K_MS_EOC) {
|
if (l_current_marker == J2K_MS_EOC) {
|
||||||
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
|
if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC) {
|
||||||
|
p_j2k->m_current_tile_number = 0;
|
||||||
|
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME DOC ???*/
|
/* FIXME DOC ???*/
|
||||||
|
|
|
@ -316,4 +316,5 @@ ac8f6ab3acc9c692ed7c41bd62a0e1e8 file1.jp2-c0-r1.tif
|
||||||
fbfcf662b6f7549574b2885490fbcf12 file1.jp2-c0-d10_20_30_40.tif
|
fbfcf662b6f7549574b2885490fbcf12 file1.jp2-c0-d10_20_30_40.tif
|
||||||
fa7382fd8b2e788b28b807e200dd95b9 file1.jp2-c0-t0.tif
|
fa7382fd8b2e788b28b807e200dd95b9 file1.jp2-c0-t0.tif
|
||||||
ac8f6ab3acc9c692ed7c41bd62a0e1e8 file1.jp2-c0-t0-r1.tif
|
ac8f6ab3acc9c692ed7c41bd62a0e1e8 file1.jp2-c0-t0-r1.tif
|
||||||
f31bcb01c771f829054cdb013575e86a issue1043.png
|
f31bcb01c771f829054cdb013575e86a issue1043.png
|
||||||
|
62bc654c830efddf1b23d6e208447dab tnsot_zero.png
|
||||||
|
|
|
@ -625,3 +625,8 @@ opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0-t0-r1.
|
||||||
!opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c10.tif -c 10
|
!opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c10.tif -c 10
|
||||||
|
|
||||||
opj_decompress -i @INPUT_NR_PATH@/db11217111510058.jp2 -o @TEMP_PATH@/issue1043.png
|
opj_decompress -i @INPUT_NR_PATH@/db11217111510058.jp2 -o @TEMP_PATH@/issue1043.png
|
||||||
|
|
||||||
|
opj_decompress -i @INPUT_NR_PATH@/tnsot_zero.jp2 -o @TEMP_PATH@/tnsot_zero.png
|
||||||
|
|
||||||
|
# try to decompress file with repeated PPT marker
|
||||||
|
!opj_decompress -i @INPUT_NR_PATH@/oss-fuzz2785.jp2 -o @TEMP_PATH@/oss-fuzz2785.png
|
||||||
|
|
|
@ -45,3 +45,4 @@ NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5
|
||||||
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
||||||
NR-DEC-issue135.j2k-68-decode-md5
|
NR-DEC-issue135.j2k-68-decode-md5
|
||||||
NR-DEC-db11217111510058.jp2-306-decode-md5
|
NR-DEC-db11217111510058.jp2-306-decode-md5
|
||||||
|
NR-DEC-tnsot_zero.jp2-307-decode-md5
|
||||||
|
|
|
@ -45,3 +45,4 @@ NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5
|
||||||
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
||||||
NR-DEC-issue135.j2k-68-decode-md5
|
NR-DEC-issue135.j2k-68-decode-md5
|
||||||
NR-DEC-db11217111510058.jp2-306-decode-md5
|
NR-DEC-db11217111510058.jp2-306-decode-md5
|
||||||
|
NR-DEC-tnsot_zero.jp2-307-decode-md5
|
||||||
|
|
|
@ -45,3 +45,4 @@ NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5
|
||||||
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
||||||
NR-DEC-issue135.j2k-68-decode-md5
|
NR-DEC-issue135.j2k-68-decode-md5
|
||||||
NR-DEC-db11217111510058.jp2-306-decode-md5
|
NR-DEC-db11217111510058.jp2-306-decode-md5
|
||||||
|
NR-DEC-tnsot_zero.jp2-307-decode-md5
|
||||||
|
|
|
@ -43,3 +43,4 @@ NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5
|
||||||
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
|
||||||
NR-DEC-issue135.j2k-68-decode-md5
|
NR-DEC-issue135.j2k-68-decode-md5
|
||||||
NR-DEC-db11217111510058.jp2-306-decode-md5
|
NR-DEC-db11217111510058.jp2-306-decode-md5
|
||||||
|
NR-DEC-tnsot_zero.jp2-307-decode-md5
|
||||||
|
|
Loading…
Reference in New Issue