mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Fix some overflows when exporting large files with blur effects
This commit is contained in:
parent
d1d4b8442f
commit
7c97fdb32a
@ -771,7 +771,7 @@ inline QRgb QgsImageOperation::GaussianBlurOperation::gaussianBlurVertical( cons
|
||||
for ( int i = 0; i <= mRadius * 2; ++i )
|
||||
{
|
||||
y = std::clamp( posy + ( i - mRadius ), 0, height - 1 );
|
||||
ref = sourceFirstLine + sourceBpl * y;
|
||||
ref = sourceFirstLine + static_cast< std::size_t >( sourceBpl ) * y;
|
||||
|
||||
QRgb *refRgb = reinterpret_cast< QRgb * >( ref );
|
||||
r += mKernel[i] * qRed( *refRgb );
|
||||
|
@ -445,7 +445,7 @@ class CORE_EXPORT QgsImageOperation
|
||||
int increment = ( mDirection == QgsImageOperation::ByRow ) ? 4 : bytesPerLine;
|
||||
if ( !mForwardDirection )
|
||||
{
|
||||
p += ( lineLength - 1 ) * increment;
|
||||
p += static_cast< std::size_t >( lineLength - 1 ) * increment;
|
||||
increment = -increment;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user