Check for invalid subsampling factor

This commit is contained in:
DRC
2011-02-23 20:51:23 +00:00
parent a311c1cd21
commit 4e08a1d3bc

View File

@@ -65,6 +65,8 @@ public class TJDecompressor {
public int getSubsamp() throws Exception {
if(jpegSubsamp < 0) throw new Exception("JPEG buffer not initialized");
if(jpegSubsamp >= TJ.NUMSAMPOPT)
throw new Exception("JPEG header information is invalid");
return jpegSubsamp;
}