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

This commit is contained in:
FranklinDM 2023-01-04 21:34:01 +08:00 committed by roytam1
commit 06d2df29b4

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.