Skip to content

UBSan abort in ext/gd/libgd/gd_interpolation.c:1007 #16559

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$input = imagecreatefrompng(__DIR__ . '/gh10614.png');
for ($angle = 0; $angle <= 270; $angle += 90) {
$output = imagerotate($input, $angle, 0);
}
$fusion = $output;
$thumbnail = imagescale($fusion, -1, 64, IMG_BICUBIC);

Resulted in this output:

/php-src/ext/gd/libgd/gd_interpolation.c:1007:28: runtime error: left shift of 134 by 24 places cannot be represented in type 'int'

PHP Version

nightly

Operating System

ubuntu 22.04

Activity

  1. ndossche commented on Oct 23, 2024

    @ndossche
    Member

    Right, alpha must be 0x7f at most; uchar_clamp in upstream takes an extra argument but we don't...

  2. self-assigned this
    on Oct 23, 2024
  3. added a commit that references this issue on Oct 23, 2024
    9e8ea5b
  4. added 3 commits that reference this issue on Oct 23, 2024
    e1e1e64
    6d6afd9
    d7e7e2b
  5. added a commit that references this issue on Oct 23, 2024
    551a9ef
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