Summary: | [WPE] Floating point exception in WebEventFactory::createWebWheelEvent | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Bentzen <cadubentzen> | ||||||||
Component: | WPE WebKit | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bugs-noreply, commit-queue, mcatanzaro, zan | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Linux | ||||||||||
Attachments: |
|
Description
Carlos Bentzen
2018-03-27 06:42:10 PDT
Created attachment 336583 [details]
Patch
The patch is only a double-check to prevent crashing but I believe it should be investigated further to prevent sending events with value = 0. Hi! I don't know if this is right or not. I'm sure Zan will review it soon; he knows this code. Comment on attachment 336583 [details] Patch >Subversion Revision: 229973 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6b224d55338fbfcc0f7299a83aa63d06a640291a..b5539ff8f658ba0f5344d4b619ddd953f9f28280 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-03-27 Carlos Eduardo Ramalho <cadubentzen@gmail.com> >+ >+ [WPE] Floating point exception in WebEventFactory::createWebWheelEvent >+ https://bugs.webkit.org/show_bug.cgi?id=184037 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/wpe/WebEventFactory.cpp: >+ (WebKit::WebEventFactory::createWebWheelEvent): >+ > 2018-03-25 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Add API to convert between DOM and JSCValue >diff --git a/Source/WebKit/Shared/wpe/WebEventFactory.cpp b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >index 6bedf6a465552951a4b63a4f0c41a6c25011e6dc..626829f6ac158e3f6dca941c4f1d2f73053a5b00 100644 >--- a/Source/WebKit/Shared/wpe/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >@@ -134,6 +134,9 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_even > > WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* event, float deviceScaleFactor) > { >+ if (!event->value) >+ return { }; >+ > // FIXME: We shouldn't hard-code this. > enum Axis { > Vertical, Opss.. Edited the patch as comment by mistake. I'll send another just fixing Changelog format. Newcomer being newcomer. Created attachment 336737 [details]
Patch
Comment on attachment 336737 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336737&action=review Let's just avoid any division by using something like `(event->value >= 0 ? 1.0 : -1.0) * std::abs(event->value)`. Or better yet, use std::copysign(). > Source/WebKit/ChangeLog:9 > + * Shared/wpe/WebEventFactory.cpp: > + (WebKit::WebEventFactory::createWebWheelEvent): Please describe the changes that are done here. See other ChangeLog entries for examples. Created attachment 336769 [details]
Patch
Comment on attachment 336769 [details] Patch Clearing flags on attachment: 336769 Committed r230074: <https://trac.webkit.org/changeset/230074> All reviewed patches have been landed. Closing bug. |