* libtiff/tif_dirread.c: add NULL check to avoid likely false positive

null-pointer dereference warning by CLang Static Analyzer.
This commit is contained in:
Even Rouault 2017-09-09 21:44:42 +00:00
parent c4a2f72e9d
commit 46c51095d6
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,9 @@
2017-09-27 Even Rouault <even.rouault at spatialys.com>
2017-09-09 Even Rouault <even.rouault at spatialys.com>
* libtiff/tif_dirread.c: add NULL check to avoid likely false positive
null-pointer dereference warning by CLang Static Analyzer.
2017-09-07 Even Rouault <even.rouault at spatialys.com>
* libtiff/tiffiop.h, tif_aux.c: redirect SeekOK() macro to a _TIFFSeekoK()
function that checks if the offset is not bigger than INT64_MAX, so as

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.217 2017-07-15 14:27:50 erouault Exp $ */
/* $Id: tif_dirread.c,v 1.218 2017-09-09 21:44:42 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -2832,7 +2832,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDi
if (direntry->tdir_count<(uint64)tif->tif_dir.td_samplesperpixel)
return(TIFFReadDirEntryErrCount);
err=TIFFReadDirEntryShortArray(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
if (err!=TIFFReadDirEntryErrOk || m == NULL)
return(err);
na=m;
nb=tif->tif_dir.td_samplesperpixel;