]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
wma afh: Read the description field as the comment tag.
authorAndre Noll <maan@systemlinux.org>
Fri, 1 Nov 2013 18:11:23 +0000 (19:11 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 16 Apr 2014 23:42:27 +0000 (23:42 +0000)
The wma audio format handler parses the entries of the ASF content
description object and interprets its fifth field as the comment tag.

This is wrong, since this field actually corresponds to the rating
information, which is usually unused. The correct field to examine
is #4.

wma_afh.c

index 7ac1ba64354ab87bbbbbd8494e6d7f171f3c30e3..c429020c4e3455aa56929d5a36e60df315de7e28 100644 (file)
--- a/wma_afh.c
+++ b/wma_afh.c
@@ -132,7 +132,7 @@ static const char album_tag_header[] = { /* WM/AlbumTitle */
 static void read_asf_tags(const char *buf, int buf_size, struct taginfo *ti)
 {
        const char *p, *end = buf + buf_size, *q;
-       uint16_t len1, len2, len3, len4, len5;
+       uint16_t len1, len2, len3, len4;
 
        p = search_pattern(comment_header, sizeof(comment_header),
                buf, buf_size);
@@ -149,7 +149,7 @@ static void read_asf_tags(const char *buf, int buf_size, struct taginfo *ti)
        p += 2;
        len4 = read_u16(p);
        p += 2;
-       len5 = read_u16(p);
+       /* ignore length of the rating information */
        p += 2;
        if (p + len1 >= end)
                goto next;
@@ -158,10 +158,10 @@ static void read_asf_tags(const char *buf, int buf_size, struct taginfo *ti)
        if (p + len2 >= end)
                goto next;
        ti->artist = get_str16(p, len2);
-       p += len2 + len3 + len4;
-       if (p + len5 >= end)
+       p += len2 + len3;
+       if (p + len4 >= end)
                goto next;
-       ti->comment = get_str16(p, len5);
+       ti->comment = get_str16(p, len4);
 next:
        p = search_pattern(extended_content_header, sizeof(extended_content_header),
                buf, buf_size);