Skip to content
Permalink
Browse files

[image cache] Avoid creating an invalid image and painting onto it

  • Loading branch information
github-actions authored and nyalldawson committed May 6, 2020
1 parent baeb482 commit b8188e294d5baff816511f847ac288f11dfa9999
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/qgsimagecache.cpp
@@ -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() );

0 comments on commit b8188e2

Please sign in to comment.
You can’t perform that action at this time.