From 19c3072e4efacf4949540c10f377b78ddb047671 Mon Sep 17 00:00:00 2001 From: monsta Date: Sun, 16 Dec 2018 12:26:39 +0300 Subject: tiff: fix possible NULL pointer dereference --- backend/tiff/tiff2ps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend') 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 ) { /* -- cgit v1.2.1