Skip to content

Commit 19c3072

Browse files
monstaraveit65
authored andcommitted
tiff: fix possible NULL pointer dereference
1 parent 6457c82 commit 19c3072

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/tiff/tiff2ps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,12 +1542,13 @@ PSDataBW(TIFF2PSContext* ctx, TIFF* tif, uint32 w, uint32 h)
15421542

15431543
(void) w; (void) h;
15441544
tf_buf = (unsigned char *) _TIFFmalloc(stripsize);
1545-
memset(tf_buf, 0, stripsize);
15461545
if (tf_buf == NULL) {
15471546
TIFFError(ctx->filename, "No space for scanline buffer");
15481547
return;
15491548
}
15501549

1550+
memset(tf_buf, 0, stripsize);
1551+
15511552
#if defined( EXP_ASCII85ENCODER )
15521553
if ( ctx->ascii85 ) {
15531554
/*

0 commit comments

Comments
 (0)