From 01d9daeb121ddf2772197a8597afa91cedb1db4e Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Wed, 14 Feb 2018 20:02:41 -0800 Subject: [PATCH] Fix ID3v2 decoding, avoid infinite loop The ID3 reader was incorrectly skipping extended headers and was cutting off the last 10 bytes of the last ID3 entry. Correct per http://id3.org specs. Fixes #41 --- src/AudioFileSourceID3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AudioFileSourceID3.cpp b/src/AudioFileSourceID3.cpp index 6bef7b1..a90020a 100644 --- a/src/AudioFileSourceID3.cpp +++ b/src/AudioFileSourceID3.cpp @@ -170,11 +170,11 @@ uint32_t AudioFileSourceID3::read(void *data, uint32_t len) id3Size = id3Size << 7; id3Size |= buff[9]; // Every read from now may be unsync'd - AudioFileSourceUnsync id3(src, id3Size-10, unsync); + AudioFileSourceUnsync id3(src, id3Size, unsync); if (exthdr) { int ehsz = (id3.getByte()<<24) | (id3.getByte()<<16) | (id3.getByte()<<8) | (id3.getByte()); - for (int j=0; j