Skip to content

integer overflow in imagefilledellipse #19739

Closed

Description

@chongwick

Description

The following code:

<?php
$v_88865 = 'Simple test of imagecopyresampled() function\n';
$v_88894 = 64;
$v_88895 = 1024;
$v_88896 = $v_88894 * $v_88895;
$v_88867 = realpath($v_88896,);
$v_88868 = dirname($v_88867,);
$v_88869 = '/imagelarge.png';
$v_88870 = $v_88868 . $v_88869;
$v_88871 = __FILE__;
$v_88872 = realpath($v_88871,);
$v_88873 = dirname($v_88872,);
$v_88874 = '/imagesmall.png';
$v_88875 = $v_88873 . $v_88874;
$v_88876 = 400;
$v_88877 = 300;
$v_88878 = imagecreatetruecolor($v_88876,$v_88877,);
$v_88879 = 0;
$v_88880 = 0;
$v_88881 = 0;
$v_88882 = imagecolorallocate($v_88878,$v_88879,$v_88880,$v_88881,);
$v_88883 = 0;
$v_88884 = 255;
$v_88885 = 0;
$v_88886 = imagecolorallocate($v_88878,$v_88883,$v_88884,$v_88885,);
$v_88888 = 150;
$v_88889 = 300;
$v_88899 = True;
$v_88900 = microtime($v_88899,);
$v_88891 = imagefilledellipse($v_88878,$v_88894,$v_88888,$v_88889,$v_88900,$v_88886,);

Resulted in this output:

/nightly_php/php-src/ext/gd/libgd/gd.c:1839:9: runtime error: signed integer overflow: 150 * 771929193354090121 cannot be represented in type 'long'

PHP Version

nightly

Operating System

ubuntu 20.04

Activity

  1. self-assigned this
    on Sep 6, 2025
  2. added a commit that references this issue on May 24, 2026
    68d01d2
  3. added 2 commits that reference this issue on May 24, 2026
    5dd3909
    4659762
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions