Skip to content

Commit

Permalink
id3.c: handle V2_FRAME_LEN_INDICATOR properly
Browse files Browse the repository at this point in the history
This fixes id3 frame parsing in case length indicator is present.

Signed-off-by: Gregory Petrosyan <gregory.petrosyan@gmail.com>
  • Loading branch information
flyingmutant authored and JasonWoof committed Feb 5, 2010
1 parent 8a4ef15 commit 62f5b73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions id3.c
Expand Up @@ -823,13 +823,24 @@ static int v2_read(struct id3tag *id3, int fd, const struct v2_header *header)
}

len = fh.size;

if (fh.flags & V2_FRAME_LEN_INDICATOR) {
/*
* Ignore the frame length 4-byte field
*/
i += 4;
len -= 4;
fh.size -= 4;
}

if (fh.flags & V2_FRAME_UNSYNC) {
int tmp = len;

unsync((unsigned char *)(buf + i), &tmp);
fh.size = tmp;
}
v2_add_frame(id3, &fh, buf + i);

i += len;
}

Expand Down

0 comments on commit 62f5b73

Please sign in to comment.