Whitelist supported image MIME types
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2017 00:14:31 +0000 (00:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2017 00:14:31 +0000 (00:14 +0000)
commit0f67dec2f3551fcb63727a7f1a2ab13c073177f4
tree98b6e80c22756d00b1ec24ade9df7177ac9d47a7
parent82687a1d27706331dbf3be765fc9ef5528afd4cc
Whitelist supported image MIME types
https://bugs.webkit.org/show_bug.cgi?id=171077

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-04-24
Reviewed by Tim Horton.

Restrict the CG port image formats to a known whitelist. Build this list from image
UTI's instead of MIME types, since the image UTI's is a superset of the MIME types.
Use this list to build the list of supported image MIME types.

* PlatformAppleWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
* platform/graphics/cg/UTIRegistry.cpp: Added.
(WebCore::allowedImageUTIs):
(WebCore::isAllowedImageUTI):
* platform/graphics/cg/UTIRegistry.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/PlatformAppleWin.cmake
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/graphics/cg/UTIRegistry.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/cg/UTIRegistry.h [new file with mode: 0644]