diff options
Diffstat (limited to 'src/3rdparty/freetype/src/gzip/inflate.c')
-rw-r--r-- | src/3rdparty/freetype/src/gzip/inflate.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/3rdparty/freetype/src/gzip/inflate.c b/src/3rdparty/freetype/src/gzip/inflate.c index 5bf5b815e5..5117e2e26a 100644 --- a/src/3rdparty/freetype/src/gzip/inflate.c +++ b/src/3rdparty/freetype/src/gzip/inflate.c @@ -170,6 +170,8 @@ int ZEXPORT inflateReset2( /* extract wrap request from windowBits parameter */ if (windowBits < 0) { + if (windowBits < -15) + return Z_STREAM_ERROR; wrap = 0; windowBits = -windowBits; } @@ -239,6 +241,8 @@ int ZEXPORT inflateInit2_( return ret; } +#ifndef Z_FREETYPE + int ZEXPORT inflateInit_( z_streamp strm, const char *version, @@ -247,8 +251,6 @@ int ZEXPORT inflateInit_( return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -#ifndef Z_FREETYPE - int ZEXPORT inflatePrime( z_streamp strm, int bits, @@ -770,8 +772,9 @@ 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); @@ -1479,8 +1482,6 @@ 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 @@ -1499,8 +1500,6 @@ int ZEXPORT inflateSyncPoint( return state->mode == STORED && state->bits == 0; } -#ifndef Z_FREETYPE - int ZEXPORT inflateCopy( z_streamp dest, z_streamp source) @@ -1548,8 +1547,6 @@ int ZEXPORT inflateCopy( return Z_OK; } -#endif /* !Z_FREETYPE */ - int ZEXPORT inflateUndermine( z_streamp strm, int subvert) @@ -1583,8 +1580,6 @@ int ZEXPORT inflateValidate( return Z_OK; } -#ifndef Z_FREETYPE - long ZEXPORT inflateMark( z_streamp strm) { |