summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Lemstra <dirk@lemstra.org>2021-11-28 10:37:16 +0100
committerDirk Lemstra <dirk@lemstra.org>2021-11-28 10:37:16 +0100
commit4434975b678ded12dc73b86219074980a6c66112 (patch)
treeba0ab29dc4771cf2d0781fe6b82337da07cf0a8d
parent80b003420d4e657379f7c96a71d421abb68a1087 (diff)
downloadlibtiff-git-4434975b678ded12dc73b86219074980a6c66112.tar.gz
Added missing null check.
-rw-r--r--libtiff/tif_print.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index 4e0082ae..db35e1c6 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -573,7 +573,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
const TIFFField *fip;
uint32_t value_count;
int mem_alloc = 0;
- void *raw_data;
+ void *raw_data = NULL;
fip = TIFFFieldWithTag(tif, tag);
if(fip == NULL)
@@ -637,7 +637,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
* _TIFFPrettyPrintField() fall down and print it as
* any other tag.
*/
- if (!_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data))
+ if (raw_data != NULL && !_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data))
_TIFFPrintField(fd, fip, value_count, raw_data);
if(mem_alloc)