]> granicus.if.org Git - libjpeg-turbo/commitdiff
Oops. tjPlaneSizeYUV() should return -1 if componentID > 0 and subsamp==TJSAMP_GRAY.
authorDRC <dcommander@users.sourceforge.net>
Thu, 23 Oct 2014 18:54:42 +0000 (18:54 +0000)
committerDRC <dcommander@users.sourceforge.net>
Thu, 23 Oct 2014 18:54:42 +0000 (18:54 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1408 632fc199-4ca6-4c93-a231-07263d6284db

ChangeLog.txt
turbojpeg.c

index e68bf99b8d8a2367d8712d3db39a0486cf1ff975..f95d6fe0aa68ff1e12c852910bcae70fe71dee17 100644 (file)
@@ -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)
 ==================
index 1acf7c4430230f8bc602a059881bf89f1476a62c..a5ca31945c95317902c6e8ef432375790e71c9b0 100644 (file)
@@ -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);