summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0025-opj_j2k_add_mct_null_data.patch
blob: 4a371e5c88945bcc985606225bd90d2d4aabd891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/third_party/libopenjpeg20/j2k.c b/third_party/libopenjpeg20/j2k.c
index 5de89cf0e..400ca8098 100644
--- a/third_party/libopenjpeg20/j2k.c
+++ b/third_party/libopenjpeg20/j2k.c
@@ -5715,7 +5715,7 @@ static OPJ_BOOL opj_j2k_add_mct(opj_tcp_t * p_tcp, opj_image_t * p_image, OPJ_UI
 
         if (l_deco_array) {
                 l_data_size = MCT_ELEMENT_SIZE[l_deco_array->m_element_type] * p_image->numcomps * p_image->numcomps;
-                if (l_deco_array->m_data_size != l_data_size) {
+                if (l_deco_array->m_data_size != l_data_size || ! l_deco_array->m_data) {
                         return OPJ_FALSE;
                 }
 
@@ -5734,7 +5734,7 @@ static OPJ_BOOL opj_j2k_add_mct(opj_tcp_t * p_tcp, opj_image_t * p_image, OPJ_UI
 
         if (l_offset_array) {
                 l_data_size = MCT_ELEMENT_SIZE[l_offset_array->m_element_type] * p_image->numcomps;
-                if (l_offset_array->m_data_size != l_data_size) {
+                if (l_offset_array->m_data_size != l_data_size || ! l_offset_array->m_data) {
                         return OPJ_FALSE;
                 }