diff options
author | Even Rouault <even.rouault@spatialys.com> | 2021-12-16 23:58:42 +0100 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2021-12-16 23:58:42 +0100 |
commit | 77ea50bba05935c2d966922a9b2e24cf4de8df17 (patch) | |
tree | 8756046146cdbbeb83048c5b22e49d9bbc844e69 | |
parent | e533f45709089b461c622fcb6510843725fb7bcc (diff) | |
download | libtiff-git-77ea50bba05935c2d966922a9b2e24cf4de8df17.tar.gz |
TIFFGetField(TIFFTAG_STRIPBYTECOUNTS/TIFFTAG_STRIPOFFSETS): return error if returned pointer is NULL (fixes #342)
-rw-r--r-- | libtiff/tif_dir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c index f8fb32d0..6dda9634 100644 --- a/libtiff/tif_dir.c +++ b/libtiff/tif_dir.c @@ -1041,11 +1041,15 @@ _TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap) case TIFFTAG_TILEOFFSETS: _TIFFFillStriles( tif ); *va_arg(ap, const uint64_t**) = td->td_stripoffset_p; + if( td->td_stripoffset_p == NULL ) + ret_val = 0; break; case TIFFTAG_STRIPBYTECOUNTS: case TIFFTAG_TILEBYTECOUNTS: _TIFFFillStriles( tif ); *va_arg(ap, const uint64_t**) = td->td_stripbytecount_p; + if( td->td_stripbytecount_p == NULL ) + ret_val = 0; break; case TIFFTAG_MATTEING: *va_arg(ap, uint16_t*) = |