Fix issue 44

git-svn-id: http://php-reader.googlecode.com/svn/trunk@208 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
svollbehr
2010-12-28 13:48:09 +00:00
parent 6eb18085f3
commit ae666f57f4
3 changed files with 40 additions and 3 deletions

View File

@@ -230,6 +230,11 @@ final class Zend_Media_Mpeg_Abs_Frame extends Zend_Media_Mpeg_Abs_Object
$this->_offset = $this->_reader->getOffset();
$header = $this->_reader->readUInt32BE();
if (!Zend_Bit_Twiddling::testAllBits(Zend_Bit_Twiddling::getValue($header, 21, 32), 0xffe)) {
require_once 'Zend/Media/Mpeg/Exception.php';
throw new Zend_Media_Mpeg_Exception
('File does not contain a valid MPEG Audio Bit Stream (Invalid frame sync)');
}
$this->_version = Zend_Bit_Twiddling::getValue($header, 19, 20);
$this->_frequencyType = Zend_Bit_Twiddling::testBit($header, 19);
$this->_layer = Zend_Bit_Twiddling::getValue($header, 17, 18);