diff options
author | Even Rouault <even.rouault@spatialys.com> | 2022-06-27 16:09:43 +0200 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2022-06-27 16:09:54 +0200 |
commit | 275735d0354e39c0ac1dc3c0db2120d6f31d1990 (patch) | |
tree | 20cec1d8960c55c3f780e2c948db891f4edc6fd8 | |
parent | 1dbcacd786fa90836efd0a4a1c5901fe35253adf (diff) | |
download | libtiff-git-275735d0354e39c0ac1dc3c0db2120d6f31d1990.tar.gz |
_TIFFCheckFieldIsValidForCodec(): return FALSE when passed a codec-specific tag and the codec is not configured (fixes #433)
This avoids crashes when querying such tags
-rw-r--r-- | libtiff/tif_dirinfo.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c index c30f569b..3371cb5c 100644 --- a/libtiff/tif_dirinfo.c +++ b/libtiff/tif_dirinfo.c @@ -1191,6 +1191,9 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag) default: return 1; } + if( !TIFFIsCODECConfigured(tif->tif_dir.td_compression) ) { + return 0; + } /* Check if codec specific tags are allowed for the current * compression scheme (codec) */ switch (tif->tif_dir.td_compression) { |