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

Collapse All | Expand All

(-)Inflater.java (-5 / +2 lines)
Lines 311-319 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();
Lines 330-343 Link Here
330
	     *   needsInput() and not finished() 
327
	     *   needsInput() and not finished() 
331
	     *   implies more output can be produced.  
328
	     *   implies more output can be produced.  
332
	     */
329
	     */
330
	    if (len == 0)
331
	      return count;
333
	    more = outputWindow.copyOutput(buf, off, len);
332
	    more = outputWindow.copyOutput(buf, off, len);
334
	    adler.update(buf, off, more);
333
	    adler.update(buf, off, more);
335
	    off += more;
334
	    off += more;
336
	    count += more;
335
	    count += more;
337
	    totalOut += more;
336
	    totalOut += more;
338
	    len -= more;
337
	    len -= more;
339
	    if (len == 0)
340
	      return count;
341
	  }
338
	  }
342
      }
339
      }
343
    while (decode() || (outputWindow.getAvailable() > 0
340
    while (decode() || (outputWindow.getAvailable() > 0

Return to bug 41696