forked from len0rd/rockbox
r22826 is causing data aborts when the wps is loaded in the parse_list function - suspected reason is an improperly aligned pointer depending on how the buffer gets setup when translating a "d".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22827 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
89041f6b4a
commit
4eee66a4cf
1 changed files with 11 additions and 2 deletions
|
|
@ -983,9 +983,18 @@ static int parse_albumart_load(const char *wps_bufptr,
|
|||
return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */
|
||||
|
||||
_pos = wps_bufptr + 1;
|
||||
_pos = parse_list("dd", NULL, '|', _pos, &aa->albumart_x, &aa->albumart_y);
|
||||
if (!isdigit(*_pos))
|
||||
return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl|@ */
|
||||
aa->albumart_x = atoi(_pos);
|
||||
|
||||
if (!_pos || _pos > newline || *_pos != '|')
|
||||
_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)
|
||||
return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate
|
||||
e.g. %Cl|7|59\n */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue