Kaydet (Commit) f519a99c authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#3763 Integer-overflow

Change-Id: If7c10d0fd188f0aafeece9545fb138761c3a2f5b
Reviewed-on: https://gerrit.libreoffice.org/43765Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b6deca4b
...@@ -1470,10 +1470,12 @@ namespace emfio ...@@ -1470,10 +1470,12 @@ namespace emfio
ReadDIB(aBitmap, aTmp, true); ReadDIB(aBitmap, aTmp, true);
// test if it is sensible to crop // test if it is sensible to crop
if ( ( cxSrc > 0 ) && ( cySrc > 0 ) && if ( (cxSrc > 0) && (cySrc > 0) &&
( xSrc >= 0 ) && ( ySrc >= 0 ) && (xSrc >= 0) && (ySrc >= 0) &&
( xSrc + cxSrc <= aBitmap.GetSizePixel().Width() ) && (aBitmap.GetSizePixel().Width() >= cxSrc) &&
( ySrc + cySrc <= aBitmap.GetSizePixel().Height() ) ) (xSrc <= aBitmap.GetSizePixel().Width() - cxSrc) &&
(aBitmap.GetSizePixel().Height() >= cySrc) &&
(ySrc <= aBitmap.GetSizePixel().Height() - cySrc) )
{ {
tools::Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) ); tools::Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) );
aBitmap.Crop( aCropRect ); aBitmap.Crop( aCropRect );
......
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