mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1149260 - Guard against trying to draw a drag image with zero length. r=enndeakin
This commit is contained in:
parent
3e7ff0d160
commit
abf7415cef
@ -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