Few clarifications in error reporting messages.

This commit is contained in:
Andrey Kiselev 2006-03-16 12:24:53 +00:00
parent b63d5bddef
commit b0672e6b1b

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.81 2006-03-15 12:49:15 dron Exp $ */ /* $Id: tif_dirread.c,v 1.82 2006-03-16 12:24:53 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -129,10 +129,9 @@ TIFFReadDirectory(TIFF* tif)
} }
if (tif->tif_flags & TIFF_SWAB) if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount); TIFFSwabShort(&dircount);
dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
dircount, sizeof (TIFFDirEntry),
sizeof (TIFFDirEntry), "to read TIFF directory");
"to read TIFF directory");
if (dir == NULL) if (dir == NULL)
return (0); return (0);
if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) { if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) {
@ -158,8 +157,9 @@ TIFFReadDirectory(TIFF* tif)
off += sizeof (uint16); off += sizeof (uint16);
if (tif->tif_flags & TIFF_SWAB) if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount); TIFFSwabShort(&dircount);
dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
dircount, sizeof (TIFFDirEntry), "to read TIFF directory"); sizeof (TIFFDirEntry),
"to read TIFF directory");
if (dir == NULL) if (dir == NULL)
return (0); return (0);
if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) { if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) {
@ -723,10 +723,9 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
} }
if (tif->tif_flags & TIFF_SWAB) if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount); TIFFSwabShort(&dircount);
dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
dircount, sizeof (TIFFDirEntry),
sizeof (TIFFDirEntry), "to read TIFF custom directory");
"to read TIFF directory");
if (dir == NULL) if (dir == NULL)
return (0); return (0);
if (!ReadOK(tif, dir, dircount * sizeof (TIFFDirEntry))) { if (!ReadOK(tif, dir, dircount * sizeof (TIFFDirEntry))) {
@ -748,8 +747,9 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
off += sizeof (uint16); off += sizeof (uint16);
if (tif->tif_flags & TIFF_SWAB) if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount); TIFFSwabShort(&dircount);
dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
dircount, sizeof (TIFFDirEntry), "to read TIFF directory"); sizeof (TIFFDirEntry),
"to read TIFF custom directory");
if (dir == NULL) if (dir == NULL)
return (0); return (0);
if (off + dircount * sizeof (TIFFDirEntry) > tif->tif_size) { if (off + dircount * sizeof (TIFFDirEntry) > tif->tif_size) {