include/oversized.h
raw| 1 | #include <limits.h> |
| 2 | /* Test if x or y are negative, or if multiplying x * y would cause an |
| 3 | * arithmetic overflow. |
| 4 | */ |
| 5 | #define oversized(x, y) \ |
| 6 | ((x) < 0 || (y) < 0 || ((y) != 0 && (x) > INT_MAX / (y))) |
| 7 | |
| 8 | #define failwith_oversized(lib) \ |
| 9 | caml_failwith("#lib error: image contains oversized or bogus width and height"); |