Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Unified Diff: ui/events/ozone/events_ozone.cc

Issue 491073002: [Ozone] Check valid GetFlingData parameters before writing to them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/events_ozone.cc
diff --git a/ui/events/ozone/events_ozone.cc b/ui/events/ozone/events_ozone.cc
index d5d75afe849a295a834c8b2a747277eac6dc851e..65ad063dde3525431ba51a24c5e1735c7d359e34 100644
--- a/ui/events/ozone/events_ozone.cc
+++ b/ui/events/ozone/events_ozone.cc
@@ -144,11 +144,17 @@ bool GetFlingData(const base::NativeEvent& native_event,
const ui::ScrollEvent* event =
static_cast<const ui::ScrollEvent*>(native_event);
DCHECK(event->IsScrollEvent());
- *vx = event->x_offset();
- *vy = event->y_offset();
- *vx_ordinal = event->x_offset_ordinal();
- *vy_ordinal = event->y_offset_ordinal();
- *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL;
+ if (vx)
+ *vx = event->x_offset();
+ if (vy)
+ *vy = event->y_offset();
+ if (vx_ordinal)
+ *vx_ordinal = event->x_offset_ordinal();
+ if (vy_ordinal)
+ *vy_ordinal = event->y_offset_ordinal();
+ if (is_cancel)
+ *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL;
+
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698