Skip to content

Commit

Permalink
id3: allow comments with description "description"
Browse files Browse the repository at this point in the history
MusicBrainz Picard writes them this way...
  • Loading branch information
weisslj authored and flyingmutant committed Aug 1, 2011
1 parent c759c9f commit 2a19a9c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions id3.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,8 @@ static void decode_txxx(struct id3tag *id3, const char *buf, int len, int encodi
static void decode_comment(struct id3tag *id3, const char *buf, int len, int encoding)
{
int slen;
char out0;
char *out;
int valid_description;

if (len <= 3)
return;
Expand All @@ -802,11 +802,10 @@ static void decode_comment(struct id3tag *id3, const char *buf, int len, int enc
if (!out)
return;

out0 = *out;
valid_description = strcmp(out, "") == 0 || strcmp(out, "description") == 0;
free(out);

/* we are interested only in comments with empty description */
if (out0 != '\0')
if (!valid_description)
return;

slen = id3_skiplen(buf, len, encoding);
Expand Down

0 comments on commit 2a19a9c

Please sign in to comment.