Issue #1382 - Fix invalid assert for decoder type if JXL is not built on debug builds

This commit is contained in:
FranklinDM committed 2023-02-20 17:22:16 +08:00
1 parent 97f69387f4
commit 8d980914af
1 file changed
+8 -4
+8 -4
View File
@@ -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.