changeset 37001:64fabc358356

Check numphases. Don't allow it to be zero.
author ib
date Fri, 28 Mar 2014 12:04:57 +0000
parents ea94ee043275
children 9402cbe067c8
files gui/skin/skin.c help/help_mp-de.h help/help_mp-en.h
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Fri Mar 28 11:40:37 2014 +0000
+++ b/gui/skin/skin.c	Fri Mar 28 12:04:57 2014 +0000
@@ -659,6 +659,11 @@
     item->Bitmap.Image = NULL;
 
     if (strcmp(phfname, "NULL") != 0) {
+        if (num == 0) {
+            skin_error(MSGTR_GUI_MSG_SkinErrorNumphases);
+            return 1;
+        }
+
         av_strlcpy(buf, path, sizeof(buf));
         av_strlcat(buf, phfname, sizeof(buf));
 
@@ -794,6 +799,11 @@
     item->Bitmap.Image = NULL;
 
     if (strcmp(phfname, "NULL") != 0) {
+        if (num == 0) {
+            skin_error(MSGTR_GUI_MSG_SkinErrorNumphases);
+            return 1;
+        }
+
         av_strlcpy(buf, path, sizeof(buf));
         av_strlcat(buf, phfname, sizeof(buf));
 
--- a/help/help_mp-de.h	Fri Mar 28 11:40:37 2014 +0000
+++ b/help/help_mp-de.h	Fri Mar 28 12:04:57 2014 +0000
@@ -921,6 +921,7 @@
 #define MSGTR_GUI_MSG_SkinErrorBitmap16Bit "Die Farbtiefe von %s beträgt 16 bpp oder weniger, was nicht unterstützt wird.\n"
 #define MSGTR_GUI_MSG_SkinErrorItem "Dieses Element wird in '%s' nicht unterstützt.\n"
 #define MSGTR_GUI_MSG_SkinErrorMessage "Fehler in der Skin-Konfigurationsdatei in Zeile %d: %s"
+#define MSGTR_GUI_MSG_SkinErrorNumphases "Die Anzahl der Phasen darf nicht null sein.\n"
 #define MSGTR_GUI_MSG_SkinErrorSection "Für '%s' wurde kein Abschnitt angegeben.\n"
 #define MSGTR_GUI_MSG_SkinErrorWindow "Für '%s' wurde kein Fenster angegeben.\n"
 #define MSGTR_GUI_MSG_SkinFileNotFound "Skin-Datei %s nicht gefunden.\n"
--- a/help/help_mp-en.h	Fri Mar 28 11:40:37 2014 +0000
+++ b/help/help_mp-en.h	Fri Mar 28 12:04:57 2014 +0000
@@ -712,6 +712,7 @@
 #define MSGTR_GUI_MSG_SkinErrorBitmap16Bit "Color depth of bitmap %s is 16 bits or less which is not supported.\n"
 #define MSGTR_GUI_MSG_SkinErrorItem "This item is not supported by '%s'.\n"
 #define MSGTR_GUI_MSG_SkinErrorMessage "Error in skin config file at line %d: %s"
+#define MSGTR_GUI_MSG_SkinErrorNumphases "The number of phases must not be zero.\n"
 #define MSGTR_GUI_MSG_SkinErrorSection "No section specified for '%s'.\n"
 #define MSGTR_GUI_MSG_SkinErrorWindow "No window specified for '%s'.\n"
 #define MSGTR_GUI_MSG_SkinFileNotFound "Skin file %s not found.\n"