TIFFFetchDirectory(): fix invalid cast from uint64 to tmsize_t. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16784
This commit is contained in:
parent
1a4efdd151
commit
244dfb46af
@ -4788,12 +4788,13 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tmsize_t m;
|
tmsize_t m;
|
||||||
tmsize_t off = (tmsize_t) tif->tif_diroff;
|
tmsize_t off;
|
||||||
if ((uint64)off!=tif->tif_diroff)
|
if (tif->tif_diroff > (uint64)TIFF_INT64_MAX)
|
||||||
{
|
{
|
||||||
TIFFErrorExt(tif->tif_clientdata,module,"Can not read TIFF directory count");
|
TIFFErrorExt(tif->tif_clientdata,module,"Can not read TIFF directory count");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
off = (tmsize_t) tif->tif_diroff;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for integer overflow when validating the dir_off,
|
* Check for integer overflow when validating the dir_off,
|
||||||
|
Loading…
Reference in New Issue
Block a user