diff --git a/ChangeLog.txt b/ChangeLog.txt index e68bf99b..f95d6fe0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,9 @@ because OS X does not provide the le32toh() and htole32() functions.) [2] The non-SIMD RGB565 color conversion code did not work correctly on big endian machines. This has been fixed. +[3] Fixed an issue in tjPlaneSizeYUV() whereby it was erroneously returning 1 +instead of -1 if componentID was > 0 and subsamp was TJSAMP_GRAY. + 1.3.90 (1.4 beta1) ================== diff --git a/turbojpeg.c b/turbojpeg.c index 1acf7c44..a5ca3194 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -689,6 +689,7 @@ DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width, pw=tjPlaneWidth(componentID, width, subsamp); ph=tjPlaneHeight(componentID, height, subsamp); + if(pw<0 || ph<0) return -1; if(stride==0) stride=pw; else stride=abs(stride);