mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
parent
470a6e4401
commit
13fcc4a046
949 changed files with 95662 additions and 444 deletions
|
|
@ -123,12 +123,20 @@ AllowedImageSize(int32_t aWidth, int32_t aHeight)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check to make sure we don't overflow 32-bit size for RGBA
|
||||
// check to make sure we don't overflow a 32-bit
|
||||
CheckedInt32 requiredBytes = CheckedInt32(aWidth) * CheckedInt32(aHeight) * 4;
|
||||
if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
|
||||
NS_WARNING("width or height too large");
|
||||
return false;
|
||||
}
|
||||
#if defined(XP_MACOSX)
|
||||
// CoreGraphics is limited to images < 32K in *height*, so clamp all surfaces
|
||||
// on the Mac to that height
|
||||
if (MOZ_UNLIKELY(aHeight > SHRT_MAX)) {
|
||||
NS_WARNING("image too big");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue