From eb22ef26d94a8bebb2cfd68306c6ba4ee679517e Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 4 Aug 2015 06:50:04 +0200 Subject: [PATCH] Another left-shift bug (#45681). * src/base/ftobjs.c (IsMacBinary): Only accept positive values for `dlen'. --- ChangeLog | 7 +++++++ src/base/ftobjs.c | 15 ++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b78fcbeea..c8ddab75f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-08-04 Werner Lemberg + + Another left-shift bug (#45681). + + * src/base/ftobjs.c (IsMacBinary): Only accept positive values for + `dlen'. + 2015-08-03 Alexei Podtelezhnikov [base] Fix `ft_corner_orientation'. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 9c3332cf3..4fa05933d 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -1889,13 +1889,14 @@ if ( error ) goto Exit; - if ( header[ 0] != 0 || - header[74] != 0 || - header[82] != 0 || - header[ 1] == 0 || - header[ 1] > 33 || - header[63] != 0 || - header[2 + header[1]] != 0 ) + if ( header[ 0] != 0 || + header[74] != 0 || + header[82] != 0 || + header[ 1] == 0 || + header[ 1] > 33 || + header[63] != 0 || + header[2 + header[1]] != 0 || + header[0x53] > 0x7F ) return FT_THROW( Unknown_File_Format ); dlen = ( header[0x53] << 24 ) |