Skip to content

Commit 99246da

Browse files
committed
guard against invalid typesize
1 parent c4cf78d commit 99246da

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/main/java/com/scalableminds/bloscjava

src/main/java/com/scalableminds/bloscjava/Blosc.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ private Blosc() {
3636
* @return the compressed byte array
3737
*/
3838
public static byte[] compress(byte[] src, int typeSize, Compressor compressor, int compressorLevel, Shuffle shuffle, int blockSize, int numThreads) {
39+
if (typeSize <1) {
40+
throw new IllegalArgumentException("Argument typeSize needs to be larger than 0.");
41+
}
3942
return _compress(src, typeSize, compressorLevel, shuffle.shuffle, blockSize, compressor.compressor, numThreads);
4043
}
4144

0 commit comments

Comments
 (0)