]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed copying only 1/3 of scanline when saving TIFF image in rare cases.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 28 Aug 2011 22:44:04 +0000 (22:44 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 28 Aug 2011 22:44:04 +0000 (22:44 +0000)
If our calculated image pitch is not equal to what TIFFScanlineSize returns a scanline buffer would be used. In that case the number of bytes being copied was equal to the image's width instead of pitch (width times 3).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagtiff.cpp

index 1083157434a6265d9cb6a41165567da2257c583c..b459d40462c94e59574798e0f325b729b36dcfc5 100644 (file)
@@ -727,7 +727,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
             if (isColouredImage)
             {
                 // color image
             if (isColouredImage)
             {
                 // color image
-                memcpy(buf, ptr, image->GetWidth());
+                memcpy(buf, ptr, image->GetWidth() * 3);
             }
             else if (spp * bps == 8) // greyscale image
             {
             }
             else if (spp * bps == 8) // greyscale image
             {