Kaydet (Commit) 5abe0ab1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid undefined out-of-bounds double -> sal_Int32 conversion

...upon empty rExtents, during "make Gallery_txtshapes"

Change-Id: Ie482041828b7abcf13d0efb5da62d1158b7f5e92
üst 1d478d5b
......@@ -1271,8 +1271,21 @@ cairo_user_data_key_t* SvpSalGraphics::getDamageKey()
void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const
{
sal_Int32 nExtentsLeft(rExtents.getMinX()), nExtentsTop(rExtents.getMinY());
sal_Int32 nExtentsRight(rExtents.getMaxX()), nExtentsBottom(rExtents.getMaxY());
sal_Int32 nExtentsLeft;
sal_Int32 nExtentsTop;
sal_Int32 nExtentsRight;
sal_Int32 nExtentsBottom;
if (rExtents.isEmpty()) {
nExtentsLeft = 0;
nExtentsTop = 0;
nExtentsRight = 0;
nExtentsBottom = 0;
} else {
nExtentsLeft = rExtents.getMinX();
nExtentsTop = rExtents.getMinY();
nExtentsRight = rExtents.getMaxX();
nExtentsBottom = rExtents.getMaxY();
}
sal_Int32 nWidth = cairo_image_surface_get_width(m_pSurface);
sal_Int32 nHeight = cairo_image_surface_get_height(m_pSurface);
nExtentsLeft = std::max<sal_Int32>(nExtentsLeft, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment