aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2016-09-06 22:33:26 +0200
committerPhilip P. Moltmann <moltmann@google.com>2017-04-10 20:24:55 +0000
commit3e2c4b9394f61fdc9aac65d2a9e288be6095ee2d (patch)
tree3da85296f2b2ea27823fa16fd3389698026d5999
parent86957661fc29ce82c3101107f95a11d1f9e59932 (diff)
downloadpdfium-3e2c4b9394f61fdc9aac65d2a9e288be6095ee2d.tar.gz
Backport 734d57d5f7842aa7c2c9f36d62131ab4d8bd6c87 from libopenjpeg20
Original commit message: > fix incrementing of "l_tcp->m_nb_mcc_records" in opj_j2k_read_mcc (#820) Bug: 35443562 Change-Id: I799f94c4f5c909c66dcedfbbbf79775ed46f3981
-rw-r--r--core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c
index 77a864ebb..e393fa9e2 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c
@@ -5320,6 +5320,7 @@ OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
OPJ_UINT32 l_nb_collections;
OPJ_UINT32 l_nb_comps;
OPJ_UINT32 l_nb_bytes_by_comp;
+ OPJ_BOOL l_new_mcc = OPJ_FALSE;
/* preconditions */
assert(p_header_data != 00);
@@ -5381,6 +5382,7 @@ OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
memset(l_mcc_record,0,(l_tcp->m_nb_max_mcc_records-l_tcp->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t));
}
l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;
+ l_new_mcc = OPJ_TRUE;
}
l_mcc_record->m_index = l_indix;
@@ -5516,7 +5518,9 @@ OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
- ++l_tcp->m_nb_mcc_records;
+ if (l_new_mcc) {
+ ++l_tcp->m_nb_mcc_records;
+ }
return OPJ_TRUE;
}