Skip to content
Permalink
Browse files

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

  • Loading branch information
nirvn authored and nyalldawson committed May 6, 2020
1 parent 55110ff commit 52b87622d474119d071bec3ec14d75b09e61f929
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 52b8762

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