summaryrefslogtreecommitdiff
path: root/java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-07-16 21:07:25 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-07-16 21:07:25 +0000
commitab26ef78141c6d3e19e8011b7d5e5570b4e53f59 (patch)
tree2f06d03438c702d537ce93a79f7930297e601de0 /java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch
parentHostDB is a system for generating internal DNS zones, (diff)
Add multiple security patches and improvements from IcedTea6 1.12.6.
http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-July/023941.html Obtained from: IcedTea Project PR: ports/180541
Diffstat (limited to 'java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch')
-rw-r--r--java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch b/java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch
new file mode 100644
index 000000000000..9d76b93f3907
--- /dev/null
+++ b/java/openjdk6/files/icedtea/security/20130618/8012421-better_positioning.patch
@@ -0,0 +1,100 @@
+# HG changeset patch
+# User prr
+# Date 1366411203 25200
+# Node ID 92ad159889b19b66a64cd3c89b628132fe089354
+# Parent 3b7e8e89595d6f0f967981d3e08fe170fd3898ef
+8012421: Better positioning of PairPositioning
+Reviewed-by: srl, mschoene, vadim
+
+diff --git a/src/share/native/sun/font/layout/PairPositioningSubtables.cpp b/src/share/native/sun/font/layout/PairPositioningSubtables.cpp
+--- jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp
++++ jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp
+@@ -76,23 +76,30 @@
+ {
+ LEGlyphID firstGlyph = glyphIterator->getCurrGlyphID();
+ le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success);
++
++ if (LE_FAILURE(success)) {
++ return 0;
++ }
+ GlyphIterator tempIterator(*glyphIterator);
+
+ if (coverageIndex >= 0 && glyphIterator->next()) {
+ Offset pairSetTableOffset = SWAPW(pairSetTableOffsetArray[coverageIndex]);
+- PairSetTable *pairSetTable = (PairSetTable *) ((char *) this + pairSetTableOffset);
++ LEReferenceTo<PairSetTable> pairSetTable(base, success, ((char *) this + pairSetTableOffset));
++ if (LE_FAILURE(success)) {
++ return 0;
++ }
+ le_uint16 pairValueCount = SWAPW(pairSetTable->pairValueCount);
+ le_int16 valueRecord1Size = ValueRecord::getSize(SWAPW(valueFormat1));
+ le_int16 valueRecord2Size = ValueRecord::getSize(SWAPW(valueFormat2));
+ le_int16 recordSize = sizeof(PairValueRecord) - sizeof(ValueRecord) + valueRecord1Size + valueRecord2Size;
+ LEGlyphID secondGlyph = glyphIterator->getCurrGlyphID();
+- const PairValueRecord *pairValueRecord = NULL;
++ LEReferenceTo<PairValueRecord> pairValueRecord;
+
+ if (pairValueCount != 0) {
+- pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize);
++ pairValueRecord = findPairValueRecord(base, (TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize, success);
+ }
+
+- if (pairValueRecord == NULL) {
++ if (pairValueRecord.isEmpty()) {
+ return 0;
+ }
+
+@@ -154,22 +161,26 @@
+ return 0;
+ }
+
+-const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGlyphID glyphID, const PairValueRecord *records, le_uint16 recordCount, le_uint16 recordSize) const
++LEReferenceTo<PairValueRecord> PairPositioningFormat1Subtable::findPairValueRecord(const LETableReference &base, TTGlyphID glyphID, const PairValueRecord *records, le_uint16 recordCount, le_uint16 recordSize, LEErrorCode &success) const
+ {
+ #if 1
+ // The OpenType spec. says that the ValueRecord table is
+ // sorted by secondGlyph. Unfortunately, there are fonts
+ // around that have an unsorted ValueRecord table.
+- const PairValueRecord *record = records;
++ LEReferenceTo<PairValueRecord> record(base, success, records);
++ record.verifyLength(0, recordSize, success);
+
+ for(le_int32 r = 0; r < recordCount; r += 1) {
++ if (LE_FAILURE(success)) return (const PairValueRecord*)NULL;
+ if (SWAPW(record->secondGlyph) == glyphID) {
+ return record;
+ }
+
+- record = (const PairValueRecord *) ((char *) record + recordSize);
++ record = LEReferenceTo<PairValueRecord>(base, success, ((const char*)record.getAlias())+ recordSize);
++ record.verifyLength(0, recordSize, success);
+ }
+ #else
++ #error dead code - not updated.
+ le_uint8 bit = OpenTypeUtilities::highBit(recordCount);
+ le_uint16 power = 1 << bit;
+ le_uint16 extra = (recordCount - power) * recordSize;
+@@ -195,7 +206,7 @@
+ }
+ #endif
+
+- return NULL;
++ return (const PairValueRecord*)NULL;
+ }
+
+ U_NAMESPACE_END
+diff --git a/src/share/native/sun/font/layout/PairPositioningSubtables.h b/src/share/native/sun/font/layout/PairPositioningSubtables.h
+--- jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h
++++ jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h
+@@ -77,8 +77,9 @@
+ le_uint32 process(const LEReferenceTo<PairPositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const;
+
+ private:
+- const PairValueRecord *findPairValueRecord(TTGlyphID glyphID, const PairValueRecord *records,
+- le_uint16 recordCount, le_uint16 recordSize) const;
++ LEReferenceTo<PairValueRecord> findPairValueRecord(const LETableReference &base, TTGlyphID glyphID, const PairValueRecord *records,
++ le_uint16 recordCount, le_uint16 recordSize, LEErrorCode &success) const;
++
+ };
+ LE_VAR_ARRAY(PairPositioningFormat1Subtable, pairSetTableOffsetArray)
+