summaryrefslogtreecommitdiff
path: root/backend/tiff/tiff2ps.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-12-16 12:26:39 +0300
committerraveit65 <[email protected]>2019-01-21 14:23:51 +0100
commit19c3072e4efacf4949540c10f377b78ddb047671 (patch)
treee334c202bf0aaf5431b6ae43d66bd33c546d2845 /backend/tiff/tiff2ps.c
parent6457c820ec6cbfcc3d4c047c9d048427c0a2b1f9 (diff)
downloadatril-19c3072e4efacf4949540c10f377b78ddb047671.tar.bz2
atril-19c3072e4efacf4949540c10f377b78ddb047671.tar.xz
tiff: fix possible NULL pointer dereference
Diffstat (limited to 'backend/tiff/tiff2ps.c')
-rw-r--r--backend/tiff/tiff2ps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/tiff/tiff2ps.c b/backend/tiff/tiff2ps.c
index 3733645d..f8933674 100644
--- a/backend/tiff/tiff2ps.c
+++ b/backend/tiff/tiff2ps.c
@@ -1542,12 +1542,13 @@ PSDataBW(TIFF2PSContext* ctx, TIFF* tif, uint32 w, uint32 h)
(void) w; (void) h;
tf_buf = (unsigned char *) _TIFFmalloc(stripsize);
- memset(tf_buf, 0, stripsize);
if (tf_buf == NULL) {
TIFFError(ctx->filename, "No space for scanline buffer");
return;
}
+ memset(tf_buf, 0, stripsize);
+
#if defined( EXP_ASCII85ENCODER )
if ( ctx->ascii85 ) {
/*