diff options
-rw-r--r-- | gs/openjpeg/libopenjpeg/t2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gs/openjpeg/libopenjpeg/t2.c b/gs/openjpeg/libopenjpeg/t2.c index 5ba0c7319..8dbe6ed49 100644 --- a/gs/openjpeg/libopenjpeg/t2.c +++ b/gs/openjpeg/libopenjpeg/t2.c | |||
@@ -889,7 +889,9 @@ OPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2, | |||
889 | 889 | ||
890 | /* EPH markers */ | 890 | /* EPH markers */ |
891 | if (p_tcp->csty & J2K_CP_CSTY_EPH) { | 891 | if (p_tcp->csty & J2K_CP_CSTY_EPH) { |
892 | if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { | 892 | if (p_max_length < 2) { |
893 | fprintf(stderr, "Not enough space for expected EPH marker\n"); | ||
894 | } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { | ||
893 | fprintf(stderr, "Error : expected EPH marker\n"); | 895 | fprintf(stderr, "Error : expected EPH marker\n"); |
894 | } else { | 896 | } else { |
895 | l_header_data += 2; | 897 | l_header_data += 2; |
@@ -1018,7 +1020,9 @@ OPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2, | |||
1018 | 1020 | ||
1019 | /* EPH markers */ | 1021 | /* EPH markers */ |
1020 | if (p_tcp->csty & J2K_CP_CSTY_EPH) { | 1022 | if (p_tcp->csty & J2K_CP_CSTY_EPH) { |
1021 | if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { | 1023 | if (p_max_length < 2) { |
1024 | fprintf(stderr, "Not enough space for expected EPH marker\n"); | ||
1025 | } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { | ||
1022 | /* TODO opj_event_msg(t2->cinfo->event_mgr, EVT_ERROR, "Expected EPH marker\n"); */ | 1026 | /* TODO opj_event_msg(t2->cinfo->event_mgr, EVT_ERROR, "Expected EPH marker\n"); */ |
1023 | } else { | 1027 | } else { |
1024 | l_header_data += 2; | 1028 | l_header_data += 2; |