Commit 1f896c1f authored by Davis King's avatar Davis King

Changed code to avoid compiler warning.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402676
parent 99913d4b
...@@ -100,7 +100,11 @@ namespace dlib ...@@ -100,7 +100,11 @@ namespace dlib
throw image_load_error(std::string("png_loader: unable to open file ") + filename); throw image_load_error(std::string("png_loader: unable to open file ") + filename);
} }
png_byte sig[8]; png_byte sig[8];
fread( sig, 1, 8, fp ); if (fread( sig, 1, 8, fp ) != 8)
{
fclose( fp );
throw image_load_error(std::string("png_loader: error reading file ") + filename);
}
if ( png_sig_cmp( sig, 0, 8 ) != 0 ) if ( png_sig_cmp( sig, 0, 8 ) != 0 )
{ {
fclose( fp ); fclose( fp );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment