summaryrefslogtreecommitdiff
path: root/junklib.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-02 13:58:28 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-02 13:58:28 +0200
commit88b4b6520c32066b088d2777372245aa8ba346f3 (patch)
tree9d1b3c33b3b1b4b033e71f2b87e7318652a9c6ba /junklib.c
parentacae4ebda94205589b7cd2c643854571e22c3173 (diff)
ignore padding bytes at end of id3v2 tags
Diffstat (limited to 'junklib.c')
-rw-r--r--junklib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/junklib.c b/junklib.c
index 74c78729..289a4d22 100644
--- a/junklib.c
+++ b/junklib.c
@@ -2376,10 +2376,14 @@ junk_id3v2_read_full (playItem_t *it, DB_id3v2_tag_t *tag_store, DB_FILE *fp) {
//if (size < 6) {
// goto error; // bad size
//}
- readptr += sz;
+
+ uint32_t padding = (readptr[9] << 0) | (header[8] << 8) | (header[7] << 16) | (header[6] << 24);
+ size -= padding;
+
if (size < sz) {
return -1; // bad size
}
+ readptr += sz;
#if 0
uint16_t extflags = (readptr[1] << 0) | (readptr[0] << 8);
readptr += 2;
@@ -2565,6 +2569,9 @@ junk_id3v2_read_full (playItem_t *it, DB_id3v2_tag_t *tag_store, DB_FILE *fp) {
*text_holders[f] = text;
}
}
+ if (text) {
+ trace ("%s = %s\n", frameid, text);
+ }
break;
}
}