Commit ec8342c
committed
Fix GH-19666: imageconvolution() unexpected nan filter value.
undefined behavior occurs during cast from float to int when the element
of the filter matrix is -INF. Port the libgd clamp helper which treats
non-finite accumulators as 0 (negative/NaN) or 255 (positive infinity)
instead of bailing out, matching upstream libgd 81d7f2e.
close GH-221291 parent 7727193 commit ec8342c
3 files changed
Lines changed: 57 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
| |||
361 | 376 | | |
362 | 377 | | |
363 | 378 | | |
| 379 | + | |
364 | 380 | | |
365 | 381 | | |
366 | 382 | | |
| |||
379 | 395 | | |
380 | 396 | | |
381 | 397 | | |
382 | | - | |
383 | | - | |
384 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
385 | 401 | | |
386 | | - | |
| 402 | + | |
387 | 403 | | |
388 | | - | |
| 404 | + | |
389 | 405 | | |
390 | 406 | | |
391 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments