Bug 1400148 - Don't use -1 to represent an unset nsCursor. r=karlt.

Because UBSan complains about casting -1:

> runtime error: load of value 4294967295, which is not a valid value for type 'nsCursor'
This commit is contained in:
Nicholas Nethercote
2017-09-15 14:34:37 +10:00
parent 0666e145eb
commit 721eb311ac
5 changed files with 13 additions and 9 deletions

View File

@@ -1012,7 +1012,7 @@ PuppetWidget::SetCursor(imgIContainer* aCursor,
return NS_ERROR_FAILURE;
}
mCursor = nsCursor(-1);
mCursor = eCursorInvalid;
mCustomCursor = aCursor;
mCursorHotspotX = aHotspotX;
mCursorHotspotY = aHotspotY;