Skip to content
Permalink
Browse files

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

  • Loading branch information
nirvn committed May 5, 2020
1 parent 5cd87c1 commit 249e405eb8ce60d290553dea7af5d0a98de1fd22
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/qgsimagecache.cpp
@@ -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() );

0 comments on commit 249e405

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