User account creation filtered due to spam.

View | Details | Raw Unified | Return to bug 41696 | Differences between
and this patch

Collapse All | Expand All

(-)Inflater.java (-25 / +17 lines)
Lines 311-347 Link Here
311
   */
311
   */
312
  public int inflate (byte[] buf, int off, int len) throws DataFormatException
312
  public int inflate (byte[] buf, int off, int len) throws DataFormatException
313
  {
313
  {
314
    /* Special case: len may be zero */
315
    if (len == 0)
316
      return 0;
317
    /* Check for correct buff, off, len triple */
314
    /* Check for correct buff, off, len triple */
318
    if (0 > off || off > off + len || off + len > buf.length)
315
    if (0 > off || off > off + len || off + len > buf.length)
319
      throw new ArrayIndexOutOfBoundsException();
316
      throw new ArrayIndexOutOfBoundsException();
320
    int count = 0;
317
    int count = 0;
321
    int more;
318
    for (;;)
322
    do
323
      {
319
      {
324
	if (mode != DECODE_CHKSUM)
320
        if (outputWindow.getAvailable() == 0)
325
	  {
321
          {
326
	    /* Don't give away any output, if we are waiting for the
322
            if (!decode())
327
	     * checksum in the input stream.
323
              break;
328
	     *
324
          }
329
	     * With this trick we have always:
325
        else if (len > 0)
330
	     *   needsInput() and not finished() 
326
          {
331
	     *   implies more output can be produced.  
327
            int more = outputWindow.copyOutput(buf, off, len);
332
	     */
328
            adler.update(buf, off, more);
333
	    more = outputWindow.copyOutput(buf, off, len);
329
            off += more;
334
	    adler.update(buf, off, more);
330
            count += more;
335
	    off += more;
331
            totalOut += more;
336
	    count += more;
332
            len -= more;
337
	    totalOut += more;
333
          }
338
	    len -= more;
334
        else
339
	    if (len == 0)
335
          break;
340
	      return count;
341
	  }
342
      }
336
      }
343
    while (decode() || (outputWindow.getAvailable() > 0
344
			&& mode != DECODE_CHKSUM));
345
    return count;
337
    return count;
346
  }
338
  }
347
339

Return to bug 41696