[webkit-changes] [WebKit/WebKit] 972234: RELEASE_ASSERT that ImageIO could install all the ...

Said Abou-Hallawa noreply at github.com
Thu Jan 30 21:39:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 97223465600a0995db98f1fd0026b5569fb12b9a
      https://github.com/WebKit/WebKit/commit/97223465600a0995db98f1fd0026b5569fb12b9a
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2025-01-30 (Thu, 30 Jan 2025)

  Changed paths:
    M Source/WebCore/platform/MIMETypeRegistry.cpp
    M Source/WebCore/platform/graphics/cg/UTIRegistry.h
    M Source/WebCore/platform/graphics/cg/UTIRegistry.mm
    M Source/WebCore/platform/network/mac/UTIUtilities.mm

  Log Message:
  -----------
  RELEASE_ASSERT that ImageIO could install all the supported image decoders
https://bugs.webkit.org/show_bug.cgi?id=280990
rdar://135375243

Reviewed by Simon Fraser.

We needs to check the return value of CGImageSourceSetAllowableTypes().

If CGImageSourceSetAllowableTypes() could not install all the supported image
decoders for any reason, we should halt the process launch and fail its creation
safely.

Because the WebPage can be reinitialized (WTR for example), it is important to
call GImageSourceSetAllowableTypes() only once and only when a WebProcess is
initialized.

In LockdownMode, WebKit enforces a very limited set of image types. UTIRegistry
must use the lockdownSupportedImageTypes instead of defaultSupportedImageTypes.
No additionalSupportedImageTypes() is allowed in LockdownMode.

* Source/WebCore/platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
* Source/WebCore/platform/graphics/cg/UTIRegistry.h:
* Source/WebCore/platform/graphics/cg/UTIRegistry.mm:
(WebCore::isLockdownModeEnabled):
(WebCore::filterSupportedImageTypes):
(WebCore::defaultSupportedImageTypes):
(WebCore::lockdownSupportedImageTypes):
(WebCore::supportedImageTypes):
(WebCore::isSupportedImageType):
(WebCore::allowableDefaultSupportedImageTypes):
(WebCore::allowableLockdownSupportedImageTypes):
(WebCore::allowableSupportedImageTypes):
(WebCore::allowableAdditionalSupportedImageTypes):
(WebCore::allowableImageTypes):
* Source/WebCore/platform/network/mac/UTIUtilities.mm:
(WebCore::setImageSourceAllowableTypes):

Canonical link: https://commits.webkit.org/289593@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list