Commit 9c2ce3bc authored by aroben@apple.com's avatar aroben@apple.com

Fix Bug 16996: Crash in createFontCustomPlatformData when loading 0-byte font via @font-face

 WebCore:

         Fix Bug 16996: Crash in createFontCustomPlatformData when loading
         0-byte font via @font-face

         <http://bugs.webkit.org/show_bug.cgi?id=16996>

         Reviewed by Hyatt.

         Test: fast/loader/font-face-empty.html

         * platform/graphics/win/FontCustomPlatformData.cpp:
         (WebCore::createFontCustomPlatformData): Null-check the buffer
         parameter.

 LayoutTests:

         Test for Bug 16996: Crash in createFontCustomPlatformData when loading
         0-byte font via @font-face

         <http://bugs.webkit.org/show_bug.cgi?id=16996>

         Reviewed by Hyatt.

         * fast/loader/font-face-empty-expected.txt: Added.
         * fast/loader/font-face-empty.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1264051a
2008-01-24 Adam Roben <aroben@apple.com>
Test for Bug 16996: Crash in createFontCustomPlatformData when loading
0-byte font via @font-face
<http://bugs.webkit.org/show_bug.cgi?id=16996>
Reviewed by Hyatt.
* fast/loader/font-face-empty-expected.txt: Added.
* fast/loader/font-face-empty.html: Added.
2008-01-24 Alexey Proskuryakov <ap@webkit.org>
http://bugs.webkit.org/show_bug.cgi?id=16993
......
This is a test for Bug 16996: Crash in createFontCustomPlatformData when loading 0-byte font via @font-face.
`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?
<style>
@font-face {
font-family: TestFont;
src: url(data:application/x-truetype-font,) format(truetype);
}
</style>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<p>This is a test for <a href="http://bugs.webkit.org/show_bug.cgi?id=16996">Bug 16996: Crash in
createFontCustomPlatformData when loading 0-byte font via @font-face</a>.</p>
<p style="font-family: TestFont">`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./~!@#$%^&amp;*()_+QWERYUIOP{}|ASDFGHJKL:"ZXCVBNM&lt;&gt;?</p>
2008-01-24 Adam Roben <aroben@apple.com>
Fix Bug 16996: Crash in createFontCustomPlatformData when loading
0-byte font via @font-face
<http://bugs.webkit.org/show_bug.cgi?id=16996>
Reviewed by Hyatt.
Test: fast/loader/font-face-empty.html
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData): Null-check the buffer
parameter.
2008-01-24 Jon Honeycutt <jhoneycutt@apple.com>
Reviewed by Anders.
......@@ -62,6 +62,9 @@ size_t getBytesWithOffset(void *info, void* buffer, size_t offset, size_t count)
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
{
if (!buffer)
return 0;
// Get CG to create the font.
CGDataProviderDirectAccessCallbacks callbacks = { &getData, &releaseData, &getBytesWithOffset, NULL };
RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateDirectAccess(buffer, buffer->size(), &callbacks));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment