diff --git a/src/Zend/Media/Id3/Frame/Comm.php b/src/Zend/Media/Id3/Frame/Comm.php index 83cbdb3..4ddbb8b 100644 --- a/src/Zend/Media/Id3/Frame/Comm.php +++ b/src/Zend/Media/Id3/Frame/Comm.php @@ -65,7 +65,7 @@ final class Zend_Media_Id3_Frame_Comm extends Zend_Media_Id3_LanguageTextFrame $encoding = $this->_reader->readUInt8(); $this->_language = strtolower($this->_reader->read(3)); - if ($this->_language == 'xxx') { + if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') { $this->_language = 'und'; } diff --git a/src/Zend/Media/Id3/Frame/Sylt.php b/src/Zend/Media/Id3/Frame/Sylt.php index 74f6a11..81b4a57 100644 --- a/src/Zend/Media/Id3/Frame/Sylt.php +++ b/src/Zend/Media/Id3/Frame/Sylt.php @@ -96,7 +96,7 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame $encoding = $this->_reader->readUInt8(); $this->_language = strtolower($this->_reader->read(3)); - if ($this->_language == 'xxx') { + if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') { $this->_language = 'und'; } $this->_format = $this->_reader->readUInt8(); @@ -110,8 +110,10 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame list($this->_description) = $this->_explodeString16 ($this->_reader->read($this->_reader->getSize()), 2); - $this->_reader->setOffset - ($offset + strlen($this->_description) + 2); + if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 2) { + $this->_reader->setOffset + ($offset + strlen($this->_description) + 2); + } break; case self::UTF8: // break intentionally omitted @@ -119,12 +121,13 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame list($this->_description) = $this->_explodeString8 ($this->_reader->read($this->_reader->getSize()), 2); - $this->_reader->setOffset - ($offset + strlen($this->_description) + 1); + if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 1) { + $this->_reader->setOffset + ($offset + strlen($this->_description) + 1); + } break; } - $this->_description = - $this->_convertString($this->_description, $encoding); + $this->_description = $this->_convertString($this->_description, $encoding); while ($this->_reader->available()) { $offset = $this->_reader->getOffset(); diff --git a/src/Zend/Media/Id3/Frame/Uslt.php b/src/Zend/Media/Id3/Frame/Uslt.php index 8c866f2..85bf134 100644 --- a/src/Zend/Media/Id3/Frame/Uslt.php +++ b/src/Zend/Media/Id3/Frame/Uslt.php @@ -64,7 +64,7 @@ final class Zend_Media_Id3_Frame_Uslt extends Zend_Media_Id3_LanguageTextFrame $encoding = $this->_reader->readUInt8(); $this->_language = strtolower($this->_reader->read(3)); - if ($this->_language == 'xxx') { + if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') { $this->_language = 'und'; } diff --git a/src/Zend/Media/Id3/LanguageTextFrame.php b/src/Zend/Media/Id3/LanguageTextFrame.php index e55063f..9346148 100644 --- a/src/Zend/Media/Id3/LanguageTextFrame.php +++ b/src/Zend/Media/Id3/LanguageTextFrame.php @@ -81,7 +81,7 @@ abstract class Zend_Media_Id3_LanguageTextFrame extends Zend_Media_Id3_Frame $encoding = $this->_reader->readUInt8(); $this->_language = strtolower($this->_reader->read(3)); - if ($this->_language == 'xxx') { + if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') { $this->_language = 'und'; }