Bug 228058 - Fix canvas overflow checking to use CheckedArithmatic rather than adhoc floating point mechanism
Summary: Fix canvas overflow checking to use CheckedArithmatic rather than adhoc float...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-18 09:27 PDT by Sam Weinig
Modified: 2021-07-19 12:40 PDT (History)
11 users (show)

See Also:


Attachments
Patch (4.33 KB, patch)
2021-07-18 09:28 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2021-07-18 09:27:36 PDT
Fix canvas overflow checking to use CheckedArithmatic rather than adhoc floating point mechanism
Comment 1 Sam Weinig 2021-07-18 09:28:25 PDT
Created attachment 433750 [details]
Patch
Comment 2 EWS 2021-07-18 12:18:28 PDT
Committed r280020 (239762@main): <https://commits.webkit.org/239762@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433750 [details].
Comment 3 Radar WebKit Bug Importer 2021-07-18 12:19:17 PDT
<rdar://problem/80748974>
Comment 4 Said Abou-Hallawa 2021-07-19 12:20:24 PDT
Comment on attachment 433750 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=433750&action=review

> Source/WebCore/html/HTMLCanvasElement.cpp:879
>  #if USE(IOSURFACE_CANVAS_BACKING_STORE)

Should not this #if be moved to the beginning of the function since #if USE(IOSURFACE_CANVAS_BACKING_STORE) is false, we are going to return false always?
Comment 5 Sam Weinig 2021-07-19 12:40:44 PDT
Comment on attachment 433750 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=433750&action=review

>> Source/WebCore/html/HTMLCanvasElement.cpp:879
>>  #if USE(IOSURFACE_CANVAS_BACKING_STORE)
> 
> Should not this #if be moved to the beginning of the function since #if USE(IOSURFACE_CANVAS_BACKING_STORE) is false, we are going to return false always?

Sure, though that seems unrelated to the change. Seems like a fine change. If I was changing something like that, I would probably also add a better macro for this that isn't platform specific.