Commit b76c03f
authored
fix: add robust RGB validation to prevent PDF color crashes (#318)
## Summary
- Adds comprehensive RGB value validation to pdf_write_color subroutine
- Handles NaN, infinity, and out-of-range color values gracefully
- Fixes critical crash in colored_contours example that was blocking
GitHub Pages deployment
## Changes
- Added IEEE_ARITHMETIC intrinsic module for NaN/infinity detection
- Implemented validation logic to check each RGB component
- Clamps values to valid [0.0, 1.0] range
- Defaults invalid values to black (0.0) for safety
## Testing
- ✅ colored_contours example now runs successfully
- ✅ All 5 PDF files generated correctly with valid content
- ✅ All existing tests continue to pass
- ✅ No regressions introduced
## Impact
This fix restores the GitHub Pages visual showcase functionality by
allowing the colored_contours example to complete successfully. The
validation ensures robust handling of edge cases in color mapping
algorithms.
Fixes #3171 parent ffde8fa commit b76c03f
2 files changed
+33
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | | - | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
68 | 72 | | |
69 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
70 | 97 | | |
71 | 98 | | |
72 | 99 | | |
| |||
0 commit comments