File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
165
165
long bits ;
166
166
unsigned char a [64 ];
167
167
unsigned long len = 64 , szlength ;
168
- int factor = 1 ,maxfactor = 16 ;
168
+ int factor = 1 ,maxfactor = 1 << 15 ;
169
169
int status = 0 ;
170
170
unsigned char * b , * buf = NULL ;
171
171
zend_string * bufz ;
@@ -197,13 +197,13 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
197
197
/*
198
198
* zlib::uncompress() wants to know the output data length
199
199
* if none was given as a parameter
200
- * we try from input length * 2 up to input length * 2^8
200
+ * we try from input length * 2 up to input length * 2^15
201
201
* doubling it whenever it wasn't big enough
202
- * that should be eneugh for all real life cases
202
+ * that should be enough for all real life cases
203
203
*/
204
204
205
205
do {
206
- szlength = ZSTR_LEN (bufz ) * (1 << factor ++ );
206
+ szlength = ZSTR_LEN (bufz ) * (factor <<= 1 );
207
207
buf = erealloc (buf , szlength );
208
208
status = uncompress (buf , & szlength , (unsigned char * ) ZSTR_VAL (bufz ), ZSTR_LEN (bufz ));
209
209
} while ((status == Z_BUF_ERROR )&& (factor < maxfactor ));
You can’t perform that action at this time.
0 commit comments