commit ab9a4057161af7f29a2b2135b25414abe5df28b1 Author: Melissa Linkert Date: Tue Mar 19 14:45:00 2013 -0400 LZW: prevent reading beyond the end of the stream Fixes #10525. diff --git a/components/scifio/src/loci/formats/codec/LZWCodec.java b/components/scifio/src/loci/formats/codec/LZWCodec.java index bb797e5..101efb6 100644 --- a/components/scifio/src/loci/formats/codec/LZWCodec.java +++ b/components/scifio/src/loci/formats/codec/LZWCodec.java @@ -402,7 +402,7 @@ public class LZWCodec extends BaseCodec { currCodeLength = 12; break; } - } while(currOutPos < output.length); + } while (currOutPos < output.length && in.getFilePointer() < in.length()); } catch (ArrayIndexOutOfBoundsException e) { throw new FormatException("Invalid LZW data", e);