Skip to content

Commit

Permalink
load_analyze(): better check for corrupted files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Nov 26, 2023
1 parent ec6a1f2 commit cb9c551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CImg.h
Original file line number Diff line number Diff line change
Expand Up @@ -56071,7 +56071,7 @@ namespace cimg_library {

unsigned char *const header = new unsigned char[header_size];
const size_t header_size_read = cimg::fread(header + 4,header_size - 4,nfile_header);
if (header_size_read!=header_size)
if (header_size_read!=header_size - 4)
throw CImgIOException(_cimg_instance
"load_analyze(): Cannot read header (of size %u) in file '%s'.",
cimg_instance,
Expand Down

0 comments on commit cb9c551

Please sign in to comment.