From d86240cf91a5fbc9a83fc974b629b1788d1d1820 Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Mon, 15 Sep 2025 18:08:16 -0600 Subject: [PATCH] APEv2: AA: Fix a couple of bugs. Change-Id: I1345d53f904d9c529dd6e2a7875dab97ffc9c2f3 --- lib/rbcodec/metadata/ape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rbcodec/metadata/ape.c b/lib/rbcodec/metadata/ape.c index f72ce9179e..a8eb11aec3 100644 --- a/lib/rbcodec/metadata/ape.c +++ b/lib/rbcodec/metadata/ape.c @@ -151,7 +151,7 @@ bool read_ape_tags(int fd, struct mp3entry* id3) r = read_string(fd, value, sizeof(value), 0, -1); r += read_string(fd, value, sizeof(value), -1, 4); - if (r == -1) + if (r < 0) { return false; } @@ -175,7 +175,7 @@ bool read_ape_tags(int fd, struct mp3entry* id3) if (id3->albumart.type != AA_TYPE_UNKNOWN) { id3->albumart.pos = lseek(fd, - 4, SEEK_CUR); - id3->albumart.size = item.length - r; + id3->albumart.size = item.length - r - 4; id3->has_embedded_albumart = true; }