From 153393af109769e21f6abd48e31c18dfcbc1f512 Mon Sep 17 00:00:00 2001 From: Marti Date: Wed, 22 Jun 2016 18:59:14 +0200 Subject: Added a check on filelen function --- utils/tificc/tificc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'utils') 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); -- cgit v1.2.3