Commit 86723f34 authored by Francois Cartegnie's avatar Francois Cartegnie

misc: acoustid: fix mbz string copy

parent fe5fe624
......@@ -81,7 +81,11 @@ static void parse_recordings( vlc_object_t *p_obj, json_value *node, acoustid_re
record->psz_title = strdup( value->u.string.ptr );
value = jsongetbyname( recordnode, "id" );
if ( value && value->type == json_string )
memcpy( record->s_musicbrainz_id, value->u.string.ptr, MB_ID_SIZE );
{
size_t i_len = strlen( value->u.string.ptr );
i_len = __MIN( i_len, MB_ID_SIZE );
memcpy( record->s_musicbrainz_id, value->u.string.ptr, i_len );
}
parse_artists( jsongetbyname( recordnode, "artists" ), record );
msg_Dbg( p_obj, "recording %d title %s %36s %s", i, record->psz_title, record->s_musicbrainz_id, record->psz_artist );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment