]> git.wh0rd.org - tt-rss.git/commitdiff
floIcon: set cap on image size
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 19:24:50 +0000 (23:24 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 19:24:50 +0000 (23:24 +0400)
lib/floIcon.php

index e9498b0e57eaa7ad0289b8efc2cd917d73ffe453..e1d1b84e2b2c234976f66e78fae8a85487b28a6f 100644 (file)
@@ -16,13 +16,13 @@ Date: 2009-03-16
 
 Changes:
 I was a little hasty on that last update.  A couple new bugs from 1.1.0 have
-been fixed.  
+been fixed.
 
 Version 1.1.0:
 Date: 2009-03-16
 
 Changes:
-Added Vista support.  
+Added Vista support.
 Fixed a number of minor bugs.  Many thanks to Dvir Berebi for pointing
         them out.
 
@@ -386,7 +386,7 @@ class floIconImage {
                 imagealphablending($imageResource, false);
                 $height = imagesy($imageResource);
                 $width = imagesx($imageResource);
-               
+
                 // Parse resource to determine header and icon format
 
                 // Find Palette information
@@ -637,7 +637,7 @@ class floIconImage {
                         $this->_imageIconFormat = $imageAsPng;
                 }
 
-       
+
         }
         function _createImageResource() {
                 if ($newImage = @imagecreatefromstring($this->_headerIconFormat.$this->_imageIconFormat)) {
@@ -780,6 +780,10 @@ class floIconImage {
                 $this->_entryIconFormat = fread($filePointer, 16);
                 $this->_entry = unpack("CWidth/CHeight/CColorCount/CReserved/SPlanes/SBitCount/LSizeInBytes/LFileOffset", $this->_entryIconFormat);
 
+                                        // fox
+                                        if ($this->_entry["SizeInBytes"] > 16384)
+                                                $this->_entry["SizeInBytes"] = 16384;
+
                 // Position the file pointer.
                 fseek($filePointer, $this->_entry["FileOffset"]);
 
@@ -840,4 +844,4 @@ class floIconImage {
                 $this->_imageResource = null;
         }
 }
-?>
\ No newline at end of file
+?>