Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp

Issue 399062: For the 249 branch:... (Closed) Base URL: svn://chrome-svn/chrome/branches/249/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp (revision 32296)
+++ third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp (working copy)
@@ -42,6 +42,7 @@
#include "FontPlatformData.h"
#include "NotImplemented.h"
+#include "OpenTypeSanitizer.h"
#include "SharedBuffer.h"
#if PLATFORM(WIN_OS)
@@ -171,6 +172,14 @@
{
ASSERT_ARG(buffer, buffer);
+#if ENABLE(OPENTYPE_SANITIZER)
+ OpenTypeSanitizer sanitizer(buffer);
+ RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
+ if (!transcodeBuffer)
+ return 0; // validation failed.
+ buffer = transcodeBuffer.get();
+#endif
+
#if PLATFORM(WIN_OS)
// Introduce the font to GDI. AddFontMemResourceEx should be used with care, because it will pollute the process's
// font namespace (Windows has no API for creating an HFONT from data without exposing the font to the

Powered by Google App Engine
This is Rietveld 408576698