[Webkit-unassigned] [Bug 25645] SVG - numeric overflow for very large elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 11 04:37:57 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=25645


Nikolas Zimmermann <zimmermann at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #58370|review?                     |review-
               Flag|                            |




--- Comment #46 from Nikolas Zimmermann <zimmermann at kde.org>  2010-06-11 04:37:54 PST ---
(From update of attachment 58370)
Patch looks good. I made up my mind regarding safeFloatToInt, I find it rather dangerous to hardcode these values. How about using:
static inline int safeFloatToInt(float x)
{
    static const int s_intMax = std::numeric_limit<int>::max();
    static const int s_intMax = std::numeric_limit<int>::min();

    if (x >= float(intMax) + 1.0f)
        return intMax;
    if (x < float(intMin)
        return intMin; // NOTE: You've returned intMin + 1, I don't know why intMin, is not allowed. But if you see errors with intMin, just return intMin+1
    return static_cast<int>(x);
}

Sorry for bringing up this so late :(

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list