boost::filesystem::path path = content->path(0).string ();
if (valid_j2k_file (path)) {
boost::uintmax_t size = boost::filesystem::file_size (path);
boost::filesystem::path path = content->path(0).string ();
if (valid_j2k_file (path)) {
boost::uintmax_t size = boost::filesystem::file_size (path);
throw FileError ("Could not open file for reading", path);
}
uint8_t* buffer = new uint8_t[size];
throw FileError ("Could not open file for reading", path);
}
uint8_t* buffer = new uint8_t[size];
- fread (buffer, 1, size, f);
+ checked_fread (buffer, size, f, path);