diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-10-12 01:16:23 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-10-12 01:16:23 +0200 |
| commit | be6ea90e13fe81a922d831b589c54554282e5545 (patch) | |
| tree | 1a3325042e68f4c17bafd814ccf29b04d99bd9b3 /src/lib | |
| parent | b8bf9bf78995526bbf0dc0536914661a07f9d2f5 (diff) | |
opj_j2k_set_threads(): add sanity check to error out if called after opj_read_header()
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/openjp2/j2k.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index ad6e1b86..6318719c 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -6419,7 +6419,9 @@ void opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters) OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads) { - if (opj_has_thread_support()) { + /* Currently we pass the thread-pool to the tcd, so we cannot re-set it */ + /* afterwards */ + if (opj_has_thread_support() && j2k->m_tcd == NULL) { opj_thread_pool_destroy(j2k->m_tp); j2k->m_tp = NULL; if (num_threads <= (OPJ_UINT32)INT_MAX) { |
