OPJ_SIZE_T h_mem_size;
int num_threads;
- if (numres == 1U) {
+ /* Not entirely sure for the return code of w == 0 which is triggered per */
+ /* https://github.com/uclouvain/openjpeg/issues/1505 */
+ if (numres == 1U || w == 0) {
return OPJ_TRUE;
}
num_threads = opj_thread_pool_get_thread_count(tp);