+1.5.3
+=====
+
+### Significant changes relative to 1.5.2:
+
+1. Fixed a NullPointerException in the TurboJPEG Java wrapper that occurred
+when using the YUVImage constructor that creates an instance backed by separate
+image planes and allocates memory for the image planes.
+
+
1.5.2
=====
/*
- * Copyright (C)2014 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2014, 2017 D. R. Commander. All Rights Reserved.
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);
- if (planes.length != nc || (offsets != null && offsets.length != nc) ||
+ if ((planes != null && planes.length != nc) ||
+ (offsets != null && offsets.length != nc) ||
(strides != null && strides.length != nc))
throw new IllegalArgumentException("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size");
+ if (planes == null)
+ planes = new byte[nc][];
if (offsets == null)
offsets = new int[nc];
if (strides == null)