X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=8710e5a002eae10c85804ec1aee911b7c8e66d22;hb=747a2ec9e0f3c49723b36da0cc77270fbecc9dfe;hp=eeda46d37d4300f4662d15ac2924fa88ebdaa311;hpb=e8462f7431582627e44906239077f1c696eefba1;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index eeda46d..8710e5a 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -1545,8 +1545,8 @@ ImageFile::readImagePNG (const char* const pszFile) if (!fp) return false; unsigned char header[8]; - fread (header, 1, 8, fp); - if (png_sig_cmp (header, 0, 8)) { + int n = fread (header, 1, 8, fp); + if (n != 8 || png_sig_cmp (header, 0, 8)) { fclose (fp); return false; }