diff options
| -rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 13 | ||||
| -rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 14 |
2 files changed, 9 insertions, 18 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index ede1871..b03bdb0 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -983,18 +983,9 @@ static int parse_albumart_load(const char *wps_bufptr, return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */ _pos = wps_bufptr + 1; - if (!isdigit(*_pos)) - return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl|@ */ - aa->albumart_x = atoi(_pos); + _pos = parse_list("dd", NULL, '|', _pos, &aa->albumart_x, &aa->albumart_y); - _pos = strchr(_pos, '|'); - if (!_pos || _pos > newline || !isdigit(*(++_pos))) - return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl|7\n or %Cl|7|@ */ - - aa->albumart_y = atoi(_pos); - - _pos = strchr(_pos, '|'); - if (!_pos || _pos > newline) + if (!_pos || _pos > newline || *_pos != '|') return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate e.g. %Cl|7|59\n */ diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index e2330a7..a5fc70d 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h @@ -226,15 +226,15 @@ struct touchregion { struct skin_albumart { /* Album art support */ struct viewport *vp;/* The viewport this is in */ - unsigned char wps_uses_albumart; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ - short albumart_x; - short albumart_y; - unsigned char albumart_xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */ - unsigned char albumart_yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */ - short albumart_max_width; - short albumart_max_height; + int albumart_x; + int albumart_y; + int albumart_max_width; + int albumart_max_height; bool draw; + unsigned char albumart_xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */ + unsigned char albumart_yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */ + unsigned char wps_uses_albumart; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ }; #endif |