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

Function lodepng_buffer_file

dependency/densecrf/examples/lodepng.cpp:373–385  ·  view source on GitHub ↗

load file into buffer that already has the correct allocated size. Returns error code.*/

Source from the content-addressed store, hash-verified

371
372/* load file into buffer that already has the correct allocated size. Returns error code.*/
373static unsigned lodepng_buffer_file(unsigned char* out, size_t size, const char* filename)
374{
375 FILE* file;
376 size_t readsize;
377 file = fopen(filename, "rb");
378 if(!file) return 78;
379
380 readsize = fread(out, 1, size, file);
381 fclose(file);
382
383 if (readsize != size) return 78;
384 return 0;
385}
386
387unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename)
388{

Callers 2

lodepng_load_fileFunction · 0.85
load_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected