Merge branch 'fix-float-compare' into 'master'

Fix comparison for max negative float value.

See merge request libtiff/libtiff!152
This commit is contained in:
Even Rouault 2020-09-11 09:41:47 +00:00
commit 57d487aa1c

View File

@ -639,7 +639,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* d
err=TIFFReadDirEntryCheckedDouble(tif,direntry,&m); err=TIFFReadDirEntryCheckedDouble(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk) if (err!=TIFFReadDirEntryErrOk)
return(err); return(err);
if ((m > FLT_MAX) || (m < FLT_MIN)) if ((m > FLT_MAX) || (m < -FLT_MAX))
return(TIFFReadDirEntryErrRange); return(TIFFReadDirEntryErrRange);
*value=(float)m; *value=(float)m;
return(TIFFReadDirEntryErrOk); return(TIFFReadDirEntryErrOk);