summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-02-20 11:12:10 +0000
committerMoonchild <moonchild@palemoon.org>2023-02-20 11:12:10 +0000
commit3076df399c0eada24fcf6116a239bf25724a42da (patch)
tree40148e2fdff56bf99227739287409a563ad8a60d
parentaa43190b9a2ec9755622625768245cf3f717c726 (diff)
parent8d980914afe4d29bbf3010007808abe333fe729f (diff)
downloaduxp-3076df399c0eada24fcf6116a239bf25724a42da.tar.gz
Merge pull request 'Fix invalid assert for decoder type if JXL is not built on debug builds' (#2114) from FranklinDM/UXP-contrib:work_jxl-assert-fix-1 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2114
-rw-r--r--image/DecoderFactory.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp
index 8acffac835..916971ba6d 100644
--- a/image/DecoderFactory.cpp
+++ b/image/DecoderFactory.cpp
@@ -202,12 +202,16 @@ DecoderFactory::CreateAnimationDecoder(DecoderType aType,
return nullptr;
}
- MOZ_ASSERT(aType == DecoderType::GIF || aType == DecoderType::PNG ||
- aType == DecoderType::WEBP
+ bool validDecoderType = (
+ aType == DecoderType::GIF ||
+ aType == DecoderType::PNG ||
+ aType == DecoderType::WEBP);
#ifdef MOZ_JXL
- || aType == DecoderType::JXL
+ validDecoderType = validDecoderType || aType == DecoderType::JXL;
#endif
- , "Calling CreateAnimationDecoder for non-animating DecoderType");
+
+ MOZ_ASSERT(validDecoderType,
+ "Calling CreateAnimationDecoder for non-animating DecoderType");
// Create an anonymous decoder. Interaction with the SurfaceCache and the
// owning RasterImage will be mediated by AnimationSurfaceProvider.