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
github-actions[bot] authored and nyalldawson committed May 15, 2020
1 parent baeb482 commit b8188e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsimagecache.cpp
Expand Up @@ -194,6 +194,10 @@ QImage QgsImageCache::renderImage( const QString &path, QSize size, const bool k

if ( ba == "broken" )
{
// 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 b8188e2

Please sign in to comment.