crashtesting: divide by zero

since:

commit 7b807a6b79
Date:   Fri Jun 21 12:28:30 2024 +0200

    tdf#161086 bitmap location wrong with SVG with an embedded PNG

bodge it by using the requested width/height and not the possibly
zero on fail actual sizes

Change-Id: Ic55ba6ce3cc14fa598299cdd1f844ee7c63fb174
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169800
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara 2024-07-01 11:43:51 +01:00
parent f02d75147e
commit af2175bb87

View file

@ -1091,8 +1091,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
Wallpaper aWallpaper(aTileImage);
aWallpaper.SetColor(COL_TRANSPARENT);
Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
aMaskRect.getY() % aTileImage.GetSizePixel().Height());
Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % nTileHeight);
tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
aWallpaper.SetRect(aPaperRect);
mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);
@ -1121,8 +1120,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
{
Wallpaper aWallpaper(aTileImage);
aWallpaper.SetColor(COL_TRANSPARENT);
Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
aMaskRect.getY() % aTileImage.GetSizePixel().Height());
Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % nTileHeight);
tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
aWallpaper.SetRect(aPaperRect);
mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);