Subject: | Incorrectly interpreting frame size |
The 'parse' method in MPEG::ID3Frame incorrectly interprets the frame
size that it extracted. In short, it needs to pass it through the handy
'MPEG::ID3v2Tag::UnMungeSize' function to convert it to the real number.
This doesn't cause any negative effects unless the frame goes beyond a
certain size. But when that happens, the rest of the tag is parsed
improperly.
I have included a (very simple) patch that fixes the problem.
Subject: | ID3v2Tag.pm.diff |
--- ID3v2Tag.pm.orig 2006-10-19 09:20:03.593750000 -0700
+++ ID3v2Tag.pm.mine 2006-10-19 09:30:49.578125000 -0700
@@ -580,6 +580,8 @@
my ($frameid, $size, $flags0, $flags1) = unpack("a4NCC", $header) ;
$self->{FRAMEID} = $frameid ;
+ my $sane_size = MPEG::ID3v2Tag::UnMungeSize($size);
+
$self->flag_tag_alter(($flags0>>7) & 1) ;
$self->flag_file_alter(($flags0>>6) & 1) ;
$self->flag_read_only(($flags0>>5) & 1) ;
@@ -588,7 +590,7 @@
$self->flag_encryption(($flags1>>6) & 1) ;
$self->flag_grouping_identity(($flags1>>5) & 1) ;
- $original_body = $body = substr($$dataref, 0, $size, "") ;
+ $original_body = $body = substr($$dataref, 0, $sane_size, "") ;
if ($self->flag_encryption() || $self->flag_grouping_identity()) {
# we don't know how to parse this field because we don't support