Skip to content

Commit 7c97fdb

Browse files
committedMar 3, 2023
Fix some overflows when exporting large files with blur effects
1 parent d1d4b84 commit 7c97fdb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/core/effects/qgsimageoperation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ inline QRgb QgsImageOperation::GaussianBlurOperation::gaussianBlurVertical( cons
771771
for ( int i = 0; i <= mRadius * 2; ++i )
772772
{
773773
y = std::clamp( posy + ( i - mRadius ), 0, height - 1 );
774-
ref = sourceFirstLine + sourceBpl * y;
774+
ref = sourceFirstLine + static_cast< std::size_t >( sourceBpl ) * y;
775775

776776
QRgb *refRgb = reinterpret_cast< QRgb * >( ref );
777777
r += mKernel[i] * qRed( *refRgb );

‎src/core/effects/qgsimageoperation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ class CORE_EXPORT QgsImageOperation
445445
int increment = ( mDirection == QgsImageOperation::ByRow ) ? 4 : bytesPerLine;
446446
if ( !mForwardDirection )
447447
{
448-
p += ( lineLength - 1 ) * increment;
448+
p += static_cast< std::size_t >( lineLength - 1 ) * increment;
449449
increment = -increment;
450450
}
451451

0 commit comments

Comments
 (0)
Please sign in to comment.