| 7562 | } |
| 7563 | |
| 7564 | static int stbi__pnm_getinteger(stbi__context *s, char *c) |
| 7565 | { |
| 7566 | int value = 0; |
| 7567 | |
| 7568 | while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) { |
| 7569 | value = value*10 + (*c - '0'); |
| 7570 | *c = (char) stbi__get8(s); |
| 7571 | if((value > 214748364) || (value == 214748364 && *c > '7')) |
| 7572 | return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int"); |
| 7573 | } |
| 7574 | |
| 7575 | return value; |
| 7576 | } |
| 7577 | |
| 7578 | static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) |
| 7579 | { |
no test coverage detected