summaryrefslogtreecommitdiff
path: root/image/DecoderFactory.cpp
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-01-04 21:34:01 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-02-20 17:22:16 +0800
commit8d980914afe4d29bbf3010007808abe333fe729f (patch)
treeea7d168b802cd910fda94d298cb0224aafb4e289 /image/DecoderFactory.cpp
parent97f69387f47baaa051e8f8da20cb6126d4cc51ab (diff)
downloaduxp-8d980914afe4d29bbf3010007808abe333fe729f.tar.gz
Issue #1382 - Fix invalid assert for decoder type if JXL is not built on debug builds
Diffstat (limited to 'image/DecoderFactory.cpp')
-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.