Commit 21b604ca authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

2008-01-12 Dimitri Glazkov <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=22936
        Fix uninitialized memory read error, reported by Purify.

        * platform/graphics/SimpleFontData.cpp:
        (WebCore::SimpleFontData::SimpleFontData): Added initializer for
            m_unitsPerEm using cDefaultUnitsPerEm constant.
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::unitsPerEm): Replaced literal value with
            the constant.
        * svg/SVGFontFaceElement.h: Added cDefaultUnitsPerEm constant.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4f74203a
2008-01-12 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=22936
Fix uninitialized memory read error, reported by Purify.
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::SimpleFontData): Added initializer for
m_unitsPerEm using cDefaultUnitsPerEm constant.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::unitsPerEm): Replaced literal value with
the constant.
* svg/SVGFontFaceElement.h: Added cDefaultUnitsPerEm constant.
2009-01-12 Adam Treat <adam.treat@torchmobile.com>
Reviewed by George Staikos.
......@@ -41,7 +41,8 @@
namespace WebCore {
SimpleFontData::SimpleFontData(const FontPlatformData& f, bool customFont, bool loading, SVGFontData* svgFontData)
: m_font(f)
: m_unitsPerEm(defaultUnitsPerEm)
, m_font(f)
, m_treatAsFixedPitch(false)
#if ENABLE(SVG_FONTS)
, m_svgFontData(svgFontData)
......
......@@ -133,7 +133,7 @@ unsigned SVGFontFaceElement::unitsPerEm() const
{
const AtomicString& value = getAttribute(units_per_emAttr);
if (value.isEmpty())
return 1000;
return defaultUnitsPerEm;
return static_cast<unsigned>(ceilf(value.toFloat()));
}
......
......@@ -31,6 +31,8 @@ namespace WebCore {
class CSSMutableStyleDeclaration;
class SVGFontElement;
const unsigned defaultUnitsPerEm = 1000;
class SVGFontFaceElement : public SVGElement {
public:
SVGFontFaceElement(const QualifiedName&, Document*);
......
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