APEv2: AA: Fix a couple of bugs.

Change-Id: I1345d53f904d9c529dd6e2a7875dab97ffc9c2f3
This commit is contained in:
James D. Smith 2025-09-15 18:08:16 -06:00 committed by James Smith
parent 5c38669476
commit d86240cf91

View file

@ -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;
}