| 2427 | } |
| 2428 | |
| 2429 | unsigned lodepng_chunk_check_crc(const unsigned char* chunk) |
| 2430 | { |
| 2431 | unsigned length = lodepng_chunk_length(chunk); |
| 2432 | unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); |
| 2433 | /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ |
| 2434 | unsigned checksum = lodepng_crc32(&chunk[4], length + 4); |
| 2435 | if(CRC != checksum) return 1; |
| 2436 | else return 0; |
| 2437 | } |
| 2438 | |
| 2439 | void lodepng_chunk_generate_crc(unsigned char* chunk) |
| 2440 | { |
no test coverage detected