diff src/aosd/aosd_osd.c @ 587:289c08270c7b trunk

[svn] - aosd: prevent user from setting an excessively large max_width
author giacomo
date Wed, 31 Jan 2007 08:59:20 -0800
parents 26519231a4f4
children 1e2792ece36b
line wrap: on
line diff
--- a/src/aosd/aosd_osd.c	Wed Jan 31 08:42:04 2007 -0800
+++ b/src/aosd/aosd_osd.c	Wed Jan 31 08:59:20 2007 -0800
@@ -134,9 +134,11 @@
 
   if ( cfg_osd->position.maxsize_width > 0 )
   {
+    gint max_width_default = screen_width - pad_left - pad_right - abs(cfg_osd->position.offset_x);
     max_width = cfg_osd->position.maxsize_width - pad_left - pad_right;
-    if ( max_width < 1 ) /* ignore user-defined max_width if it is too small */
-      max_width = screen_width - pad_left - pad_right - abs(cfg_osd->position.offset_x);
+    /* ignore user-defined max_width if it is too small or too large */
+    if ( max_width < 1 ) || ( max_width > max_width_default )
+      max_width = max_width_default;
   }
   else
   {