diff options
author | Even Rouault <even.rouault@spatialys.com> | 2023-03-26 16:27:40 +0200 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2023-03-26 16:27:40 +0200 |
commit | b8b12c44c1a8c622fc98f8e76f66e5e5edac3b8e (patch) | |
tree | 12048360516ff074e27f7578128265b33e9bc9ef | |
parent | 214fe59954644efe69c4681587d0dee64575dd0c (diff) | |
download | libtiff-git-b8b12c44c1a8c622fc98f8e76f66e5e5edac3b8e.tar.gz |
tif_ovrcache.c: check TIFFSetSubDirectory() return value (CID 1524573)
-rw-r--r-- | contrib/addtiffo/tif_ovrcache.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/addtiffo/tif_ovrcache.c b/contrib/addtiffo/tif_ovrcache.c index 4153189b..9cbf09d1 100644 --- a/contrib/addtiffo/tif_ovrcache.c +++ b/contrib/addtiffo/tif_ovrcache.c @@ -43,6 +43,7 @@ TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset) { TIFFOvrCache *psCache; toff_t nBaseDirOffset; + int nRet; psCache = (TIFFOvrCache *)_TIFFmalloc(sizeof(TIFFOvrCache)); psCache->nDirOffset = nDirOffset; @@ -52,7 +53,9 @@ TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset) /* Get definition of this raster from the TIFF file itself. */ /* -------------------------------------------------------------------- */ nBaseDirOffset = TIFFCurrentDirOffset(psCache->hTIFF); - TIFFSetSubDirectory(hTIFF, nDirOffset); + nRet = TIFFSetSubDirectory(hTIFF, nDirOffset); + (void)nRet; + assert(nRet == 1); TIFFGetField(hTIFF, TIFFTAG_IMAGEWIDTH, &(psCache->nXSize)); TIFFGetField(hTIFF, TIFFTAG_IMAGELENGTH, &(psCache->nYSize)); @@ -120,7 +123,9 @@ TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset) psCache->nBlockOffset = 0; - TIFFSetSubDirectory(psCache->hTIFF, nBaseDirOffset); + nRet = TIFFSetSubDirectory(psCache->hTIFF, nBaseDirOffset); + (void)nRet; + assert(nRet == 1); return psCache; } |