1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-21 05:11:44 +02:00

* Assert when image with negative size is being requested.

This commit is contained in:
Christian Muehlhaeuser
2014-09-11 17:07:23 +02:00
parent c04875503f
commit a02dce9db1
2 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -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 )
{