diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc b/third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc index d12947ce55..558c9dbe42 100644 --- a/third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc +++ b/third_party/jpeg-xl/lib/threads/thread_parallel_runner.cc @@ -41,11 +41,13 @@ bool ThreadMemoryManagerInit(JxlMemoryManager* self, } else { memset(self, 0, sizeof(*self)); } - if (!self->alloc != !self->free) { + bool is_default_alloc = (self->alloc == nullptr); + bool is_default_free = (self->free == nullptr); + if (is_default_alloc != is_default_free) { return false; } - if (!self->alloc) self->alloc = ThreadMemoryManagerDefaultAlloc; - if (!self->free) self->free = ThreadMemoryManagerDefaultFree; + if (is_default_alloc) self->alloc = ThreadMemoryManagerDefaultAlloc; + if (is_default_free) self->free = ThreadMemoryManagerDefaultFree; return true; } @@ -57,7 +59,7 @@ void* ThreadMemoryManagerAlloc(const JxlMemoryManager* memory_manager, void ThreadMemoryManagerFree(const JxlMemoryManager* memory_manager, void* address) { - return memory_manager->free(memory_manager->opaque, address); + memory_manager->free(memory_manager->opaque, address); } } // namespace |