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

Function lodepng_load_file

dependency/densecrf/examples/lodepng.cpp:387–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename)
388{
389 long size = lodepng_filesize(filename);
390 if (size < 0) return 78;
391 *outsize = (size_t)size;
392
393 *out = (unsigned char*)lodepng_malloc((size_t)size);
394 if(!(*out) && size > 0) return 83; /*the above malloc failed*/
395
396 return lodepng_buffer_file(*out, (size_t)size, filename);
397}
398
399/*write given buffer to the file, overwriting the file, it doesn't append to it.*/
400unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename)

Callers 1

lodepng_decode_fileFunction · 0.85

Calls 3

lodepng_filesizeFunction · 0.85
lodepng_mallocFunction · 0.85
lodepng_buffer_fileFunction · 0.85

Tested by

no test coverage detected