OLD | NEW |
1 /* $Id: tif_dirread.c,v 1.191 2015-09-05 20:31:41 bfriesen Exp $ */ | 1 /* $Id: tif_dirread.c,v 1.191 2015-09-05 20:31:41 bfriesen Exp $ */ |
2 | 2 |
3 /* | 3 /* |
4 * Copyright (c) 1988-1997 Sam Leffler | 4 * Copyright (c) 1988-1997 Sam Leffler |
5 * Copyright (c) 1991-1997 Silicon Graphics, Inc. | 5 * Copyright (c) 1991-1997 Silicon Graphics, Inc. |
6 * | 6 * |
7 * Permission to use, copy, modify, distribute, and sell this software and | 7 * Permission to use, copy, modify, distribute, and sell this software and |
8 * its documentation for any purpose is hereby granted without fee, provided | 8 * its documentation for any purpose is hereby granted without fee, provided |
9 * that (i) the above copyright notices and this permission notice appear in | 9 * that (i) the above copyright notices and this permission notice appear in |
10 * all copies of the software and related documentation, and (ii) the names of | 10 * all copies of the software and related documentation, and (ii) the names of |
(...skipping 5354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5365 /* | 5365 /* |
5366 * Fetch a set of offsets or lengths. | 5366 * Fetch a set of offsets or lengths. |
5367 * While this routine says "strips", in fact it's also used for tiles. | 5367 * While this routine says "strips", in fact it's also used for tiles. |
5368 */ | 5368 */ |
5369 static int | 5369 static int |
5370 TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp) | 5370 TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp) |
5371 { | 5371 { |
5372 static const char module[] = "TIFFFetchStripThing"; | 5372 static const char module[] = "TIFFFetchStripThing"; |
5373 enum TIFFReadDirEntryErr err; | 5373 enum TIFFReadDirEntryErr err; |
5374 uint64* data; | 5374 uint64* data; |
| 5375 _TIFFfree(*lpp); |
| 5376 *lpp = 0; |
5375 err=TIFFReadDirEntryLong8Array(tif,dir,&data); | 5377 err=TIFFReadDirEntryLong8Array(tif,dir,&data); |
5376 if (err!=TIFFReadDirEntryErrOk) | 5378 if (err!=TIFFReadDirEntryErrOk) |
5377 { | 5379 { |
5378 const TIFFField* fip = TIFFFieldWithTag(tif,dir->tdir_tag); | 5380 const TIFFField* fip = TIFFFieldWithTag(tif,dir->tdir_tag); |
5379 TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name :
"unknown tagname",0); | 5381 TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name :
"unknown tagname",0); |
5380 return(0); | 5382 return(0); |
5381 } | 5383 } |
5382 if (dir->tdir_count!=(uint64)nstrips) | 5384 if (dir->tdir_count!=(uint64)nstrips) |
5383 { | 5385 { |
5384 uint64* resizeddata; | 5386 uint64* resizeddata; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5605 | 5607 |
5606 | 5608 |
5607 /* vim: set ts=8 sts=8 sw=8 noet: */ | 5609 /* vim: set ts=8 sts=8 sw=8 noet: */ |
5608 /* | 5610 /* |
5609 * Local Variables: | 5611 * Local Variables: |
5610 * mode: c | 5612 * mode: c |
5611 * c-basic-offset: 8 | 5613 * c-basic-offset: 8 |
5612 * fill-column: 78 | 5614 * fill-column: 78 |
5613 * End: | 5615 * End: |
5614 */ | 5616 */ |
OLD | NEW |