mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1149260 - Guard against trying to draw a drag image with zero length. r=enndeakin
This commit is contained in:
parent
9cffc6129c
commit
f8e5361559
@ -5168,6 +5168,8 @@ PresShell::PaintRangePaintInfo(nsTArray<nsAutoPtr<RangePaintInfo> >* aItems,
|
||||
|
||||
pixelArea.width = NSToIntFloor(float(pixelArea.width) * scale);
|
||||
pixelArea.height = NSToIntFloor(float(pixelArea.height) * scale);
|
||||
if (!pixelArea.width || !pixelArea.height)
|
||||
return nullptr;
|
||||
|
||||
// adjust the screen position based on the rescaled size
|
||||
nscoord left = rootScreenRect.x + pixelArea.x;
|
||||
|
@ -612,6 +612,8 @@ nsBaseDragService::DrawDragForImage(nsPresContext* aPresContext,
|
||||
|
||||
destSize.width = NSToIntFloor(float(destSize.width) * scale);
|
||||
destSize.height = NSToIntFloor(float(destSize.height) * scale);
|
||||
if (destSize.width == 0 || destSize.height == 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
aScreenDragRect->x = NSToIntFloor(aScreenX - float(mImageX) * scale);
|
||||
aScreenDragRect->y = NSToIntFloor(aScreenY - float(mImageY) * scale);
|
||||
|
Loading…
Reference in New Issue
Block a user