shithub: libtags

Download patch

ref: ff132dfac2ed09e1351ba9ca46ed96bed2698530
parent: ac70a98c87cfa0ad9d8a2684fa88f4d449093188
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Dec 19 13:50:27 EST 2019

id3v2: don't stop at false frame sync

--- a/id3v2.c
+++ b/id3v2.c
@@ -438,9 +438,12 @@
 			if(isid3(d))
 				goto header;
 		}
-		if((b = memchr(ctx->buf, 0xff, sz-1)) != nil && (b[1] & 0xe0) == 0xe0){
-			offset = ctx->seek(ctx, (char*)b - ctx->buf + offset + exsz, 0);
-			break;
+		for(b = (uchar*)ctx->buf; (b = memchr(b, 0xff, sz-3)) != nil; b++){
+			if((b[1] & 0xe0) == 0xe0){
+				offset = ctx->seek(ctx, (char*)b - ctx->buf + offset + exsz, 0);
+				exsz = 2048;
+				break;
+			}
 		}
 	}