mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Protect point and line pattern symbol layer from eating too much memory
This commit is contained in:
parent
eea57cfc2a
commit
b54c75cef7
@ -747,6 +747,13 @@ void QgsLinePatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& conte
|
||||
int dx = 0;
|
||||
int dy = 0;
|
||||
|
||||
if ( width > 10000 || height > 10000 ) //protect symbol layer from eating too much memory
|
||||
{
|
||||
QImage img;
|
||||
mBrush.setTextureImage( img );
|
||||
return;
|
||||
}
|
||||
|
||||
QImage patternImage( width, height, QImage::Format_ARGB32 );
|
||||
patternImage.fill( 0 );
|
||||
QPainter p( &patternImage );
|
||||
@ -1049,6 +1056,13 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont
|
||||
double width = context.outputPixelSize( mDistanceX ) * 2.0;
|
||||
double height = context.outputPixelSize( mDistanceY ) * 2.0;
|
||||
|
||||
if ( width > 10000 || height > 10000 ) //protect symbol layer from eating too much memory
|
||||
{
|
||||
QImage img;
|
||||
mBrush.setTextureImage( img );
|
||||
return;
|
||||
}
|
||||
|
||||
QImage patternImage( width, height, QImage::Format_ARGB32 );
|
||||
patternImage.fill( 0 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user