Fix bug with convert int

Some bugged file have $data less from four bytes. This fix append zero bytes if it happens.

It is prevent errors on access to need indexes.
This commit is contained in:
Enyby 2016-09-30 23:50:38 +03:00 committed by Adrien Crivelli
parent 5a3e2435c3
commit 102c19356f
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 5 additions and 0 deletions

View File

@ -302,6 +302,11 @@ class OLERead
*/
private static function getInt4d($data, $pos)
{
$len = strlen($data);
if ($len < $pos + 4) {
$data .= str_repeat("\0", $pos + 4 - $len);
}
// FIX: represent numbers correctly on 64-bit system
// http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334
// Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems