From 85521acc1a35d954e81f29e27044205305a1351a Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Wed, 31 Dec 2003 09:49:47 +0000 Subject: [PATCH] Fixed problem with _TIFFrealloc() when the NULL pointer passed. Patch supplied by Larry Grill. --- libtiff/tif_win32.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c index b9e277d5..15656a45 100644 --- a/libtiff/tif_win32.c +++ b/libtiff/tif_win32.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_win32.c,v 1.6 2000-04-04 14:54:34 mwelles Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_win32.c,v 1.7 2003-12-31 09:49:47 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -226,6 +226,10 @@ _TIFFrealloc(tdata_t p, tsize_t s) { void* pvTmp; tsize_t old=GlobalSize(p); + + if(p==NULL) + return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); + if (old>=s) { if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {