File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 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)
165165 long bits ;
166166 unsigned char a [64 ];
167167 unsigned long len = 64 , szlength ;
168- int factor = 1 ,maxfactor = 16 ;
168+ int factor = 1 ,maxfactor = 1 << 15 ;
169169 int status = 0 ;
170170 unsigned char * b , * buf = NULL ;
171171 zend_string * bufz ;
@@ -197,13 +197,13 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
197197 /*
198198 * zlib::uncompress() wants to know the output data length
199199 * 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
201201 * 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
203203 */
204204
205205 do {
206- szlength = ZSTR_LEN (bufz ) * (1 << factor ++ );
206+ szlength = ZSTR_LEN (bufz ) * (factor <<= 1 );
207207 buf = erealloc (buf , szlength );
208208 status = uncompress (buf , & szlength , (unsigned char * ) ZSTR_VAL (bufz ), ZSTR_LEN (bufz ));
209209 } while ((status == Z_BUF_ERROR )&& (factor < maxfactor ));
You can’t perform that action at this time.
0 commit comments