Bug #73019 [NEW]: getimageszie can not recognize a special kind of jpg file
| From: | zws at ahtvu dot ah dot cn | Date: | Mon, 05 Sep 2016 09:45:12 +0000 |
| Subject: | Bug #73019 [NEW]: getimageszie can not recognize a special kind of jpg file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203801@lists.php.net to get a copy of this message | ||
From: zws at ahtvu dot ah dot cn
Operating system: any
PHP version: 7.0.10
Package: GetImageSize related
Bug Type: Bug
Bug description:getimageszie can not recognize a special kind of jpg file
Description:
------------
I found a problem when php recongize a jpg file.This file can be
rendered by acdsee,ie,firefox,etc,but getimagesize function returns
false.
Your can download the file from url
http://bm.ahtvu.ah.cn/img/20163/a/6/5177/org_faceimg.jpg.
This file have a lot of zeros between jpg data sections,I check php
source code and find that php_next_marker function can not cope with
it.
I give the following patch which I can not ensure ok under any
circumstances.
[root@cache84 standard]# diff image.c patch_image.c
416c416
< } while (marker == 0xff);
---
> } while (marker == 0xff || marker == 0);
Test script:
---------------
<?php
var_dump(getimagesize('/root/f.jpg'));
--
Edit bug report at https://bugs.php.net/bug.php?id=73019&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73019&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73019&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73019&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73019&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73019&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73019&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73019&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73019&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73019&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73019&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73019&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73019&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73019&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73019&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73019&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73019&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73019&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73019&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73019&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73019&r=mysqlcfg