Changeset 229328 in webkit
- Timestamp:
- Mar 6, 2018 10:35:49 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229327 r229328 1 2018-03-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Change the type of SVGToOTFFontConverter::m_weight to be not a char 4 https://bugs.webkit.org/show_bug.cgi?id=183339 5 6 Reviewed by Alex Christensen. 7 8 No new tests because there is no behavior change. 9 10 * svg/SVGToOTFFontConversion.cpp: 11 (WebCore::SVGToOTFFontConverter::appendOS2Table): 12 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): 13 1 14 2018-03-06 Antoine Quint <graouts@apple.com> 2 15 -
trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp
r229202 r229328 265 265 unsigned m_featureCountGSUB; 266 266 unsigned m_tablesAppendedCount; 267 charm_weight;267 uint8_t m_weight; 268 268 bool m_italic; 269 269 bool m_error { false }; … … 500 500 append16(2); // Version 501 501 append16(clampTo<int16_t>(averageAdvance)); 502 append16( clampTo<uint16_t>(m_weight)); // Weight class502 append16(m_weight); // Weight class 503 503 append16(5); // Width class 504 504 append16(0); // Protected font … … 526 526 bool ok; 527 527 int value = segment.toInt(&ok); 528 if (ok && value >= 0 && value <= 0xFF)528 if (ok && value >= std::numeric_limits<uint8_t>::min() && value <= std::numeric_limits<uint8_t>::max()) 529 529 panoseBytes[numPanoseBytes++] = value; 530 530 } … … 1462 1462 int value = segment.toInt(ok); 1463 1463 if (ok && value >= 0 && value < 1000) { 1464 m_weight = (value + 50) / 100;1464 m_weight = std::max(std::min((value + 50) / 100, static_cast<int>(std::numeric_limits<uint8_t>::max())), static_cast<int>(std::numeric_limits<uint8_t>::min())); 1465 1465 break; 1466 1466 }
Note: See TracChangeset
for help on using the changeset viewer.