mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
Fix a potentially non-returning function in base64 code.
This commit is contained in:
parent
f3101133d7
commit
df564040b5
1 changed files with 7 additions and 2 deletions
|
|
@ -45,6 +45,7 @@ static int pos(char c)
|
||||||
if (c >= '0' && c <= '9') return c - '0' + 52;
|
if (c >= '0' && c <= '9') return c - '0' + 52;
|
||||||
if (c == '+') return 62;
|
if (c == '+') return 62;
|
||||||
if (c == '/') return 63;
|
if (c == '/') return 63;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_base64_encode(const void *data, int size, char **str)
|
int pa_base64_encode(const void *data, int size, char **str)
|
||||||
|
|
@ -97,8 +98,12 @@ static unsigned int token_decode(const char *token)
|
||||||
marker++;
|
marker++;
|
||||||
else if (marker > 0)
|
else if (marker > 0)
|
||||||
return DECODE_ERROR;
|
return DECODE_ERROR;
|
||||||
else
|
else {
|
||||||
val += pos(token[i]);
|
int lpos = pos(token[i]);
|
||||||
|
if (lpos < 0)
|
||||||
|
return DECODE_ERROR;
|
||||||
|
val += lpos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (marker > 2)
|
if (marker > 2)
|
||||||
return DECODE_ERROR;
|
return DECODE_ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue