diff --git a/src/libtomahawk/utils/ImageRegistry.cpp b/src/libtomahawk/utils/ImageRegistry.cpp index 0ced33387..17e6eb8f3 100644 --- a/src/libtomahawk/utils/ImageRegistry.cpp +++ b/src/libtomahawk/utils/ImageRegistry.cpp @@ -57,6 +57,12 @@ ImageRegistry::cacheKey( const QSize& size, float opacity, QColor tint ) QPixmap ImageRegistry::pixmap( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode, float opacity, QColor tint ) { + if ( size.width() < 0 || size.height() < 0 ) + { + Q_ASSERT( false ); + return QPixmap(); + } + QHash< qint64, QPixmap > subsubcache; QHash< int, QHash< qint64, QPixmap > > subcache; diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.cpp b/src/libtomahawk/utils/TomahawkUtilsGui.cpp index be45cb725..1fb184c6c 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.cpp +++ b/src/libtomahawk/utils/TomahawkUtilsGui.cpp @@ -478,6 +478,11 @@ QPixmap defaultPixmap( ImageType type, ImageMode mode, const QSize& size ) { QPixmap pixmap; + if ( size.width() < 0 || size.height() < 0 ) + { + Q_ASSERT( false ); + return pixmap; + } switch ( type ) {