fix fax3 runs initialization sizing

This commit is contained in:
Frank Warmerdam 2012-06-21 02:01:31 +00:00
parent b48c0a0604
commit ea64110a44
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2012-06-20 Frank Warmerdam <warmerdam@google.com> 2012-06-20 Frank Warmerdam <warmerdam@google.com>
* libtiff/tif_fax3.c: fix memory initialization of runs, only
partly done.
* libtiff/tif_pixarlog.c: Make sure tbuf is large enough for one * libtiff/tif_pixarlog.c: Make sure tbuf is large enough for one
full "stride" past the end. full "stride" past the end.

View File

@ -1,4 +1,4 @@
/* $Id: tif_fax3.c,v 1.73 2012-06-13 00:27:20 fwarmerdam Exp $ */ /* $Id: tif_fax3.c,v 1.74 2012-06-21 02:01:31 fwarmerdam Exp $ */
/* /*
* Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1990-1997 Sam Leffler
@ -526,7 +526,7 @@ Fax3SetupState(TIFF* tif)
"for Group 3/4 run arrays"); "for Group 3/4 run arrays");
if (dsp->runs == NULL) if (dsp->runs == NULL)
return (0); return (0);
memset( dsp->runs, 0, TIFFSafeMultiply(uint32,nruns,2)); memset( dsp->runs, 0, TIFFSafeMultiply(uint32,nruns,2)*sizeof(uint32));
dsp->curruns = dsp->runs; dsp->curruns = dsp->runs;
if (needsRefLine) if (needsRefLine)
dsp->refruns = dsp->runs + nruns; dsp->refruns = dsp->runs + nruns;