php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74956 exif_read_data() causes Illegal IFD size
Submitted: 2017-07-20 11:52 UTC Modified: 2017-07-22 21:08 UTC
From: burzum at doomzone dot de Assigned: kalle (profile)
Status: Closed Package: EXIF related
PHP Version: 7.0.21 OS: Ubuntu Linux
Private report: No CVE-ID: None
 [2017-07-20 11:52 UTC] burzum at doomzone dot de
Description:
------------
This is basically a regression of 

* https://bugs.php.net/bug.php?id=72914
* https://bugs.php.net/bug.php?id=72819

that happens in 7.0.21 as well.

See https://travis-ci.org/burzum/cakephp-imagine-plugin/jobs/255629376 or the excerpt of the log below:

$ php --version
PHP 7.0.21 (cli) (built: Jul  9 2017 15:30:45) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.21, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

1.07s$ vendor/bin/phpunit
PHPUnit 5.7.19 by Sebastian Bergmann and contributors.
.......E................                                          24 / 24 (100%)
Time: 983 ms, Memory: 29.07MB
There was 1 error:
1) Burzum\Imagine\Test\TestCase\Lib\ImagineUtilityTest::testGetImageOrientation
exif_read_data(Portrait_6.jpg): Illegal IFD size
/home/travis/build/burzum/cakephp-imagine-plugin/src/Lib/ImagineUtility.php:100
/home/travis/build/burzum/cakephp-imagine-plugin/tests/TestCase/Lib/ImagineUtilityTest.php:75
ERRORS!
Tests: 24, Assertions: 31, Errors: 1.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-21 21:12 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2017-07-21 21:12 UTC] kalle@php.net
Can you test and confirm if this happens with PHP 7.2.0 Beta 1?
 [2017-07-22 14:16 UTC] burzum at doomzone dot de
-Status: Feedback +Status: Open
 [2017-07-22 14:16 UTC] burzum at doomzone dot de
Here is the output for testing php7.2beta1. It works there. Is this going to be fix in 7.1 as well?

C:\webstack
λ .\php7\php.exe -v
PHP 7.0.0 (cli) (built: Dec  3 2015 09:31:54) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC2, Copyright (c) 2002-2015, by Derick Rethans
C:\webstack
λ .\php7.2beta1\php.exe -v
PHP 7.2.0beta1 (cli) (built: Jul 18 2017 23:15:15) ( NTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
C:\webstack

C:\webstack
λ .\php7.2beta1\php.exe .\test.php
array (
  'FileName' => 'Portrait_6.jpg',
  'FileDateTime' => 1478695885,
  'FileSize' => 136257,
  'FileType' => 2,
  'MimeType' => 'image/jpeg',
  'SectionsFound' => 'ANY_TAG, IFD0, EXIF',
  'COMPUTED' =>
  array (
    'html' => 'width="600" height="450"',
    'Height' => 450,
    'Width' => 600,
    'IsColor' => 1,
    'ByteOrderMotorola' => 1,
  ),
  'Orientation' => 6,
  'XResolution' => '72/1',
  'YResolution' => '72/1',
  'ResolutionUnit' => 2,
  'Exif_IFD_Pointer' => 90,
  'ExifImageWidth' => 600,
  'ExifImageLength' => 450,
)
C:\webstack
λ .\php7.1\php.exe .\test.php
PHP Warning:  exif_read_data(Portrait_6.jpg): Illegal IFD size in C:\webstack\test.php on line 3

Warning: exif_read_data(Portrait_6.jpg): Illegal IFD size in C:\webstack\test.php on line 3
array (
  'FileName' => 'Portrait_6.jpg',
  'FileDateTime' => 1478695885,
  'FileSize' => 136257,
  'FileType' => 2,
  'MimeType' => 'image/jpeg',
  'SectionsFound' => 'ANY_TAG, IFD0, EXIF',
  'COMPUTED' =>
  array (
    'html' => 'width="600" height="450"',
    'Height' => 450,
    'Width' => 600,
    'IsColor' => 1,
    'ByteOrderMotorola' => 1,
  ),
  'Orientation' => 6,
  'XResolution' => '72/1',
  'YResolution' => '72/1',
  'ResolutionUnit' => 2,
  'ExifImageWidth' => 600,
  'ExifImageLength' => 450,
)
C:\webstack
λ
 [2017-07-22 21:05 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=342694
Log: Fixed bug #74956 (exif_read_data() causes Illegal IFD size)
 [2017-07-22 21:06 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2017-07-22 21:06 UTC] kalle@php.net
I must admit, I don't think it will find its way to lower branches as its a part of a larger changeset to the exif extension in 7.2+ I'm afraid :(
 [2017-07-22 21:08 UTC] kalle@php.net
^ Ignore the commit, I was fixing another exif related bug
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC