summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/j2k.c
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2015-12-11 15:09:59 -0800
committerOliver Chang <ochang@chromium.org>2015-12-11 15:09:59 -0800
commite2eb04f0352d621bc8837217078c23d67044bf38 (patch)
treec4e4e1cc896e05f67b8f7cc173e9a556d0b52330 /third_party/libopenjpeg20/j2k.c
parent08750d0400f1635ac33c3234cb11b192f31a1eeb (diff)
downloadpdfium-e2eb04f0352d621bc8837217078c23d67044bf38.tar.xz
openjpeg: fix incrementing of "l_tcp->m_nb_mcc_records" in opj_j2k_read_mcc
R=tsepez@chromium.org, antonin@gmail.com, mathieu.malaterre@gmail.com BUG=554129 Review URL: https://codereview.chromium.org/1488303004 .
Diffstat (limited to 'third_party/libopenjpeg20/j2k.c')
-rw-r--r--third_party/libopenjpeg20/j2k.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/third_party/libopenjpeg20/j2k.c b/third_party/libopenjpeg20/j2k.c
index 849d0b4242..b20f219bf1 100644
--- a/third_party/libopenjpeg20/j2k.c
+++ b/third_party/libopenjpeg20/j2k.c
@@ -5341,6 +5341,7 @@ static 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 new_mcc = OPJ_FALSE;
/* preconditions */
assert(p_header_data != 00);
@@ -5402,6 +5403,7 @@ static 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;
+ new_mcc = OPJ_TRUE;
}
l_mcc_record->m_index = l_indix;
@@ -5537,7 +5539,9 @@ static OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
- ++l_tcp->m_nb_mcc_records;
+ if (new_mcc) {
+ ++l_tcp->m_nb_mcc_records;
+ }
return OPJ_TRUE;
}