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
This commit is contained in:
1 parent
54498a21a0
commit
01d9daeb12
1 file changed
+2
-2
@@ -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<ehsz; j++) id3.getByte(); // Throw it away
|
||||
for (int j=0; j<ehsz-4; j++) id3.getByte(); // Throw it away
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
Reference in new issue
Block a user