mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
The inline metadata text was losing the final character when the string length was a
multiple of 16. svn path=/icecast/trunk/icecast/; revision=7089
This commit is contained in:
parent
19b1a168b5
commit
085f8d61aa
@ -125,9 +125,9 @@ static int send_metadata(client_t *client, mp3_client_data *client_state,
|
|||||||
|
|
||||||
fullmetadata_size = strlen (source_state->metadata) + sizeof (meta_fmt);
|
fullmetadata_size = strlen (source_state->metadata) + sizeof (meta_fmt);
|
||||||
|
|
||||||
if (fullmetadata_size > 4080)
|
if (fullmetadata_size > 4079)
|
||||||
{
|
{
|
||||||
fullmetadata_size = 4080;
|
fullmetadata_size = 4079;
|
||||||
}
|
}
|
||||||
fullmetadata = malloc (fullmetadata_size);
|
fullmetadata = malloc (fullmetadata_size);
|
||||||
if (fullmetadata == NULL)
|
if (fullmetadata == NULL)
|
||||||
@ -140,13 +140,13 @@ static int send_metadata(client_t *client, mp3_client_data *client_state,
|
|||||||
|
|
||||||
if (fullmetadata_size > 0 && source_age != client_state->metadata_age)
|
if (fullmetadata_size > 0 && source_age != client_state->metadata_age)
|
||||||
{
|
{
|
||||||
len_byte = (fullmetadata_size-1)/16 + 1; /* to give 1-255 */
|
len_byte = (fullmetadata_size)/16 + 1; /* to give 1-255 */
|
||||||
client_state->metadata_offset = 0;
|
client_state->metadata_offset = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
len_byte = 0;
|
len_byte = 0;
|
||||||
len = 1 + len_byte*16;
|
len = 1 + len_byte*16;
|
||||||
buf = malloc (len);
|
buf = calloc (1, len);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user