Skip to content

Commit

Permalink
[image cache] Avoid creating an invalid image and painting onto it
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed May 5, 2020
1 parent 5cd87c1 commit 249e405
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsimagecache.cpp
Expand Up @@ -208,6 +208,10 @@ QImage QgsImageCache::renderImage( const QString &path, QSize size, const bool k
{
isBroken = true;

// if the size parameter is not valid, skip drawing of missing image symbol
if ( !size.isValid() )
return im;

// if image size is set to respect aspect ratio, correct for broken image aspect ratio
if ( size.width() == 0 )
size.setWidth( size.height() );
Expand Down

0 comments on commit 249e405

Please sign in to comment.