Bug 228058

Summary: Fix canvas overflow checking to use CheckedArithmatic rather than adhoc floating point mechanism
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, darin, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, sabouhallawa, sam, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.