mmenu: minimal fix for the bad skin crash sz_173
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 13 Dec 2015 22:08:56 +0000 (00:08 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 13 Dec 2015 22:08:56 +0000 (00:08 +0200)
minimenu/mmui.c

index abdd63b..7282b71 100644 (file)
@@ -2472,6 +2472,10 @@ SDL_Surface *ui_scale_image ( SDL_Surface *s, unsigned int maxwidth, int maxheig
   double scaley = 1000000.0;
   SDL_Surface *scaled;
 
+  if ( maxwidth != -1 && maxwidth > ui_display_context.screen_width )
+    // probably bad config
+    return ( s );
+
   scalex = (double)maxwidth / (double)s -> w;
 
   if ( maxheight == -1 ) {