Skip to content

Conversation

@devnexen
Copy link
Contributor

@devnexen devnexen commented Sep 2, 2025

src/gd_filter.c Outdated
new_g = (new_g > 255.0f)? 255.0f : ((new_g < 0.0f)? 0.0f:new_g);
new_b = (new_b > 255.0f)? 255.0f : ((new_b < 0.0f)? 0.0f:new_b);

if (isnan(new_r)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think isnan() returns true for INFINITE; wouldn't isfinite() be more suitable?

Also, I'm not sure whether that needs feature detection/fallback.

Anyway, thanks for the PR! (Consider to add a test.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but INF also provokes a crash. Sure I ll add a test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice you re member tough :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I meant that isnan(INFINITY) is 0, if I'm not mistaken.

I don't think that the test is exercised. It needs to be added to https://github.com/libgd/libgd/blob/master/tests/gdimageconvolution/CMakeLists.txt and also to the Makemodule.am files (and apparently, bug00369.c is missing from CMakeLists.txt).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I did added to CMakeLists only locally ... sure.

@devnexen devnexen force-pushed the php_gh19674 branch 2 times, most recently from 7ca1415 to 4ec9f0a Compare September 2, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants