From 827679dd9f7c68befc4bf816c7fe7da6ccb9d2db Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 10 Feb 2023 23:57:30 +0000 Subject: freetype 2.13.0 git-svn-id: svn://tug.org/texlive/trunk@65782 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/freetype2/freetype-src/src/gzip/inflate.c | 55 ++++++++++------------ 1 file changed, 25 insertions(+), 30 deletions(-) (limited to 'Build/source/libs/freetype2/freetype-src/src/gzip/inflate.c') diff --git a/Build/source/libs/freetype2/freetype-src/src/gzip/inflate.c b/Build/source/libs/freetype2/freetype-src/src/gzip/inflate.c index 87e263bbdfc..5117e2e26a4 100644 --- a/Build/source/libs/freetype2/freetype-src/src/gzip/inflate.c +++ b/Build/source/libs/freetype2/freetype-src/src/gzip/inflate.c @@ -118,7 +118,7 @@ local int inflateStateCheck( return 0; } -static int ZEXPORT inflateResetKeep( +int ZEXPORT inflateResetKeep( z_streamp strm) { struct inflate_state FAR *state; @@ -144,7 +144,7 @@ static int ZEXPORT inflateResetKeep( return Z_OK; } -static int ZEXPORT inflateReset( +int ZEXPORT inflateReset( z_streamp strm) { struct inflate_state FAR *state; @@ -157,7 +157,7 @@ static int ZEXPORT inflateReset( return inflateResetKeep(strm); } -static int ZEXPORT inflateReset2( +int ZEXPORT inflateReset2( z_streamp strm, int windowBits) { @@ -170,6 +170,8 @@ static int ZEXPORT inflateReset2( /* extract wrap request from windowBits parameter */ if (windowBits < 0) { + if (windowBits < -15) + return Z_STREAM_ERROR; wrap = 0; windowBits = -windowBits; } @@ -195,7 +197,7 @@ static int ZEXPORT inflateReset2( return inflateReset(strm); } -static int ZEXPORT inflateInit2_( +int ZEXPORT inflateInit2_( z_streamp strm, int windowBits, const char *version, @@ -239,7 +241,9 @@ static int ZEXPORT inflateInit2_( return ret; } -static int ZEXPORT inflateInit_( +#ifndef Z_FREETYPE + +int ZEXPORT inflateInit_( z_streamp strm, const char *version, int stream_size) @@ -247,9 +251,7 @@ static int ZEXPORT inflateInit_( return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -#ifndef Z_FREETYPE - -static int ZEXPORT inflatePrime( +int ZEXPORT inflatePrime( z_streamp strm, int bits, int value) @@ -626,7 +628,7 @@ local int updatewindow( will return Z_BUF_ERROR if it has not reached the end of the stream. */ -static int ZEXPORT inflate( +int ZEXPORT inflate( z_streamp strm, int flush) { @@ -770,8 +772,9 @@ static int ZEXPORT inflate( if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); @@ -1304,7 +1307,7 @@ static int ZEXPORT inflate( return ret; } -static int ZEXPORT inflateEnd( +int ZEXPORT inflateEnd( z_streamp strm) { struct inflate_state FAR *state; @@ -1320,7 +1323,7 @@ static int ZEXPORT inflateEnd( #ifndef Z_FREETYPE -static int ZEXPORT inflateGetDictionary( +int ZEXPORT inflateGetDictionary( z_streamp strm, Bytef *dictionary, uInt *dictLength) @@ -1343,7 +1346,7 @@ static int ZEXPORT inflateGetDictionary( return Z_OK; } -static int ZEXPORT inflateSetDictionary( +int ZEXPORT inflateSetDictionary( z_streamp strm, const Bytef *dictionary, uInt dictLength) @@ -1378,7 +1381,7 @@ static int ZEXPORT inflateSetDictionary( return Z_OK; } -static int ZEXPORT inflateGetHeader( +int ZEXPORT inflateGetHeader( z_streamp strm, gz_headerp head) { @@ -1429,7 +1432,7 @@ local unsigned syncsearch( return next; } -static int ZEXPORT inflateSync( +int ZEXPORT inflateSync( z_streamp strm) { unsigned len; /* number of bytes to look at or looked at */ @@ -1479,8 +1482,6 @@ static int ZEXPORT inflateSync( return Z_OK; } -#endif /* !Z_FREETYPE */ - /* Returns true if inflate is currently at the end of a block generated by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP @@ -1489,7 +1490,7 @@ static int ZEXPORT inflateSync( block. When decompressing, PPP checks that at the end of input packet, inflate is waiting for these length bytes. */ -static int ZEXPORT inflateSyncPoint( +int ZEXPORT inflateSyncPoint( z_streamp strm) { struct inflate_state FAR *state; @@ -1499,9 +1500,7 @@ static int ZEXPORT inflateSyncPoint( return state->mode == STORED && state->bits == 0; } -#ifndef Z_FREETYPE - -static int ZEXPORT inflateCopy( +int ZEXPORT inflateCopy( z_streamp dest, z_streamp source) { @@ -1548,9 +1547,7 @@ static int ZEXPORT inflateCopy( return Z_OK; } -#endif /* !Z_FREETYPE */ - -static int ZEXPORT inflateUndermine( +int ZEXPORT inflateUndermine( z_streamp strm, int subvert) { @@ -1568,7 +1565,7 @@ static int ZEXPORT inflateUndermine( #endif } -static int ZEXPORT inflateValidate( +int ZEXPORT inflateValidate( z_streamp strm, int check) { @@ -1583,9 +1580,7 @@ static int ZEXPORT inflateValidate( return Z_OK; } -#ifndef Z_FREETYPE - -static long ZEXPORT inflateMark( +long ZEXPORT inflateMark( z_streamp strm) { struct inflate_state FAR *state; @@ -1598,7 +1593,7 @@ static long ZEXPORT inflateMark( (state->mode == MATCH ? state->was - state->length : 0)); } -static unsigned long ZEXPORT inflateCodesUsed( +unsigned long ZEXPORT inflateCodesUsed( z_streamp strm) { struct inflate_state FAR *state; -- cgit v1.2.3