aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-06 20:34:00 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-06 20:34:00 +0000
commit81720da06dbcaa156bab5d3283df0faaa0334b63 (patch)
tree17b7316462528c5f4c903b8179053d3f792990bc /src/player.c
parentb29f73c819ff8445b71963d883364e315b7a12d8 (diff)
downloadmpd-81720da06dbcaa156bab5d3283df0faaa0334b63.tar.gz
mpd-81720da06dbcaa156bab5d3283df0faaa0334b63.tar.xz
mpd-81720da06dbcaa156bab5d3283df0faaa0334b63.zip
slightly safer copying of metadataChunk to MpdTag
git-svn-id: https://svn.musicpd.org/mpd/trunk@1359 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/player.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/player.c b/src/player.c
index e6da9aeb9..3ddd21062 100644
--- a/src/player.c
+++ b/src/player.c
@@ -478,16 +478,16 @@ Song * playerCurrentDecodeSong() {
sizeof(MetadataChunk)))))
{
printf("metadata in the PLAYER!\n");
+ if(prev) free(prev);
+ prev = malloc(sizeof(MetadataChunk));
+ memcpy(prev, &(pc->metadataChunk), sizeof(MetadataChunk));
+ resetPlayerMetadata();
if(song) freeJustSong(song);
song = newNullSong();
if(song->utf8url) free(song->utf8url);
song->utf8url = strdup(pc->currentUrl);
- song->tag = metadataChunkToMpdTagDup(&(pc->metadataChunk));
+ song->tag = metadataChunkToMpdTagDup(prev);
validateUtf8Tag(song->tag);
- if(prev) free(prev);
- prev = malloc(sizeof(MetadataChunk));
- memcpy(prev, &(pc->metadataChunk), sizeof(MetadataChunk));
- resetPlayerMetadata();
return song;
}