Bug #73213 [NEW]: Integer overflow in imageline() with antialiasing
From: cmb
Operating system: 32bit,LLP64
PHP version: 5.6.26
Package: GD related
Bug Type: Bug
Bug description:Integer overflow in imageline() with antialiasing
Description:
------------
Drawing very large antialised lines causes integer overflows in
gdImageAALine(), what can lead to strange results and even
crashes.
This issue had been reported upstream as
<https://github.com/libgd/libgd/issues/5> and
fixed, but the fix
didn't yet make it to PHP's bundled libgd.
Test script:
---------------
<?php
$im = imagecreatetruecolor(32768, 1);
$black = imagecolorallocate($im, 0, 0, 0);
imageantialias($im, true);
imageline($im, 0,0, 32767,0, $black);
imagepng($im, __DIR__ . DIRECTORY_SEPARATOR . 'aa-bug.png');
Expected result:
----------------
A PNG image with a line.
Actual result:
--------------
PHP crashes.
--
Edit bug report at https://bugs.php.net/bug.php?id=73213&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73213&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73213&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73213&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73213&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73213&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73213&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73213&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73213&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73213&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73213&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73213&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73213&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73213&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73213&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73213&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73213&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73213&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73213&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73213&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73213&r=mysqlcfg
Thread (2 messages)
- cmb@php.net