Bug 1420525 - Initialize nsIFrame::Cursor to avoid uninitialized value inside. r?tnikkel draft
authorXidorn Quan <me@upsuper.org>
Tue, 28 Nov 2017 17:28:37 -0600
changeset 704789 e468764aaa5c6d303bbce405ba1d943d05e07714
parent 704788 a7d930b2c45bbd80b5f3e9e430e68a3f78de588e
child 742154 411ca59ac5594dd19ad5baeb214dc9d0516b14f9
push id91241
push userxquan@mozilla.com
push dateTue, 28 Nov 2017 23:45:26 +0000
reviewerstnikkel
bugs1420525
milestone59.0a1
Bug 1420525 - Initialize nsIFrame::Cursor to avoid uninitialized value inside. r?tnikkel MozReview-Commit-ID: EjAUocKMwl9
layout/generic/nsIFrame.h
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -1981,20 +1981,20 @@ public:
 
   /**
    * This structure holds information about a cursor. mContainer represents a
    * loaded image that should be preferred. If it is not possible to use it, or
    * if it is null, mCursor should be used.
    */
   struct MOZ_STACK_CLASS Cursor {
     nsCOMPtr<imgIContainer> mContainer;
-    int32_t                 mCursor;
-    bool                    mHaveHotspot;
-    bool                    mLoading;
-    float                   mHotspotX, mHotspotY;
+    int32_t mCursor = NS_STYLE_CURSOR_AUTO;
+    bool mHaveHotspot = false;
+    bool mLoading = false;
+    float mHotspotX = 0.0f, mHotspotY = 0.0f;
   };
   /**
    * Get the cursor for a given frame.
    */
   virtual nsresult  GetCursor(const nsPoint&  aPoint,
                               Cursor&         aCursor) = 0;
 
   /**