Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarti <marti.maria@tktbrainpower.com>2016-06-22 19:59:14 +0300
committerMarti <marti.maria@tktbrainpower.com>2016-06-22 19:59:14 +0300
commit153393af109769e21f6abd48e31c18dfcbc1f512 (patch)
treeefeb4b02cff565a8f9c04ad4d164dfe6db1cb614 /utils
parent5b066f73069b11d3dc933f679e210d7d56920db2 (diff)
Added a check on filelen function
Diffstat (limited to 'utils')
-rw-r--r--utils/tificc/tificc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/tificc/tificc.c b/utils/tificc/tificc.c
index cc97bbb..9ebf45e 100644
--- a/utils/tificc/tificc.c
+++ b/utils/tificc/tificc.c
@@ -657,13 +657,16 @@ static
void DoEmbedProfile(TIFF* Out, const char* ProfileFile)
{
FILE* f;
- cmsUInt32Number size, EmbedLen;
+ cmsInt32Number size;
+ cmsUInt32Number EmbedLen;
cmsUInt8Number* EmbedBuffer;
f = fopen(ProfileFile, "rb");
if (f == NULL) return;
size = cmsfilelength(f);
+ if (size < 0) return;
+
EmbedBuffer = (cmsUInt8Number*) malloc(size + 1);
if (EmbedBuffer == NULL) {
OutOfMem(size+1);