# HG changeset patch # User ib # Date 1396520161 0 # Node ID df052000865cbbba5ccac2d8d023caab3030ed82 # Parent 0790f864cea2845c2da75af19bb3a3fbfbdf1932 Check potmeter and pimage default value in skin configuration file. The value has to be in the range of 0 to 100. diff -r 0790f864cea2 -r df052000865c gui/skin/skin.c --- a/gui/skin/skin.c Thu Apr 03 09:47:41 2014 +0000 +++ b/gui/skin/skin.c Thu Apr 03 10:16:01 2014 +0000 @@ -625,6 +625,11 @@ h = cutInt(in, ',', 9); cutStr(in, buf, ',', 10); + if (d < 0 || d > 100) { + skin_error(MSGTR_GUI_MSG_SkinErrorDefault, d); + return 1; + } + message = appFindMessage(buf); if (message == -1) { @@ -769,6 +774,11 @@ h = cutInt(in, ',', 6); cutStr(in, buf, ',', 7); + if (d < 0 || d > 100) { + skin_error(MSGTR_GUI_MSG_SkinErrorDefault, d); + return 1; + } + message = appFindMessage(buf); if (message == -1) { diff -r 0790f864cea2 -r df052000865c help/help_mp-de.h --- a/help/help_mp-de.h Thu Apr 03 09:47:41 2014 +0000 +++ b/help/help_mp-de.h Thu Apr 03 10:16:01 2014 +0000 @@ -919,6 +919,7 @@ #define MSGTR_GUI_MSG_SkinCfgNotFound "Skin '%s' nicht gefunden.\n" #define MSGTR_GUI_MSG_SkinCfgSelectedNotFound "Ausgewähltes Skin '%s' nicht gefunden, es wird mit Skin 'default' versucht ...\n" #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_SkinErrorDefault "Vorgabewert (%d) außerhalb des Wertebereichs\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" diff -r 0790f864cea2 -r df052000865c help/help_mp-en.h --- a/help/help_mp-en.h Thu Apr 03 09:47:41 2014 +0000 +++ b/help/help_mp-en.h Thu Apr 03 10:16:01 2014 +0000 @@ -710,6 +710,7 @@ #define MSGTR_GUI_MSG_SkinCfgNotFound "Skin '%s' not found.\n" #define MSGTR_GUI_MSG_SkinCfgSelectedNotFound "Selected skin '%s' not found, trying skin 'default'...\n" #define MSGTR_GUI_MSG_SkinErrorBitmap16Bit "Color depth of bitmap %s is 16 bits or less which is not supported.\n" +#define MSGTR_GUI_MSG_SkinErrorDefault "Default (%d) out of range\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"