Bug 534352. Accept fonts with redundant cmap sentinel value. r=jdaggett

This commit is contained in:
Jonathan Kew 2009-12-22 09:47:18 +00:00
parent e30078c6f9
commit 8df008c3ba
5 changed files with 37 additions and 3 deletions

View File

@ -317,13 +317,13 @@ gfxFontUtils::ReadCMAPTableFormat4(PRUint8 *aBuf, PRUint32 aLength, gfxSparseBit
const PRUint16 endCount = ReadShortAt16(endCounts, i);
const PRUint16 startCount = ReadShortAt16(startCounts, i);
const PRUint16 idRangeOffset = ReadShortAt16(idRangeOffsets, i);
// sanity-check range
NS_ENSURE_TRUE((startCount > prevEndCount || i == 0) &&
NS_ENSURE_TRUE((startCount > prevEndCount || i == 0 || startCount == 0xFFFF) &&
startCount <= endCount,
NS_ERROR_GFX_CMAP_MALFORMED);
prevEndCount = endCount;
if (idRangeOffset == 0) {
aCharacterMap.SetRange(startCount, endCount);
} else {

View File

@ -0,0 +1,12 @@
<html>
<head>
<style type="text/css">
body {
font-family: serif;
}
</style>
</head>
<body>
This should NOT be in the default serif font.
</body>
</html>

View File

@ -0,0 +1,19 @@
<html>
<head>
<!-- font Prototype.ttf (see bug 496573 comment #25 and bug 534352)
has a redundant [0xFFFF,0xFFFF] sentinel value in the cmap -->
<style type="text/css">
@font-face {
font-family: test;
src: url(../fonts/Prototype.ttf);
}
body {
font-family: test, serif;
}
</style>
</head>
<body>
This should NOT be in the default serif font.
</body>
</html>

View File

@ -118,3 +118,6 @@ HTTP(..) != 507960-1-woff-bad-hint.html 507960-1-ref.html
HTTP(..) == underline-offset-change-1.html underline-offset-change-1-ref.html
HTTP(..) == underline-offset-change-2.html underline-offset-change-2-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") fails-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) != underline-offset-change-1-ref.html underline-offset-change-2-ref.html # Bug 534132
# Bug 534352
HTTP(..) != 534352-1-extra-cmap-sentinel.html 534352-1-extra-cmap-sentinel-ref.html

Binary file not shown.