MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / lodepng_chunk_check_crc

Function lodepng_chunk_check_crc

dependency/densecrf/examples/lodepng.cpp:2464–2472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2462}
2463
2464unsigned lodepng_chunk_check_crc(const unsigned char* chunk)
2465{
2466 unsigned length = lodepng_chunk_length(chunk);
2467 unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]);
2468 /*the CRC is taken of the data and the 4 chunk type letters, not the length*/
2469 unsigned checksum = lodepng_crc32(&chunk[4], length + 4);
2470 if(CRC != checksum) return 1;
2471 else return 0;
2472}
2473
2474void lodepng_chunk_generate_crc(unsigned char* chunk)
2475{

Callers 1

decodeGenericFunction · 0.85

Calls 3

lodepng_chunk_lengthFunction · 0.85
lodepng_read32bitIntFunction · 0.85
lodepng_crc32Function · 0.85

Tested by

no test coverage detected