import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
* @subpackage FileParser
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Png.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: Png.php 18993 2009-11-15 17:09:16Z alexander $
|
||||
*/
|
||||
|
||||
/** Zend_Pdf_FileParser_Image */
|
||||
@ -178,6 +178,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
|
||||
while($size - $this->getOffset() >= 8) {
|
||||
$chunkLength = $this->readUInt(4);
|
||||
if($chunkLength < 0 || ($chunkLength + $this->getOffset() + 4) > $size) {
|
||||
require_once 'Zend/Pdf/Exception.php';
|
||||
throw new Zend_Pdf_Exception("PNG Corrupt: Invalid Chunk Size In File.");
|
||||
}
|
||||
|
||||
@ -208,6 +209,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
|
||||
}
|
||||
}
|
||||
if(empty($this->_imageData)) {
|
||||
require_once 'Zend/Pdf/Exception.php';
|
||||
throw new Zend_Pdf_Exception ( "This PNG is corrupt. All png must contain IDAT chunks." );
|
||||
}
|
||||
}
|
||||
@ -215,6 +217,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
|
||||
protected function _parseIHDRChunk() {
|
||||
$this->moveToOffset(12); //IHDR must always start at offset 12 and run for 17 bytes
|
||||
if(!$this->readBytes(4) == 'IHDR') {
|
||||
require_once 'Zend/Pdf/Exception.php';
|
||||
throw new Zend_Pdf_Exception( "This PNG is corrupt. The first chunk in a PNG file must be IHDR." );
|
||||
}
|
||||
$this->_width = $this->readUInt(4);
|
||||
@ -225,6 +228,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
|
||||
$this->_preFilter = $this->readInt(1);
|
||||
$this->_interlacing = $this->readInt(1);
|
||||
if($this->_interlacing != Zend_Pdf_Image::PNG_INTERLACING_DISABLED) {
|
||||
require_once 'Zend/Pdf/Exception.php';
|
||||
throw new Zend_Pdf_Exception( "Only non-interlaced images are currently supported." );
|
||||
}
|
||||
}
|
||||
@ -317,10 +321,9 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
|
||||
case Zend_Pdf_Image::PNG_CHANNEL_GRAY_ALPHA:
|
||||
//Fall through to the next case
|
||||
case Zend_Pdf_Image::PING_CHANNEL_RGB_ALPHA:
|
||||
require_once 'Zend/Pdf/Exception.php';
|
||||
throw new Zend_Pdf_Exception( "tRNS chunk illegal for Alpha Channel Images" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user