From a000de7794cb20bdd772e76dda87baa27642056b Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Sun, 28 Aug 2011 22:44:04 +0000 Subject: [PATCH] Fixed copying only 1/3 of scanline when saving TIFF image in rare cases. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 1083157434..b459d40462 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -727,7 +727,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo if (isColouredImage) { // color image - memcpy(buf, ptr, image->GetWidth()); + memcpy(buf, ptr, image->GetWidth() * 3); } else if (spp * bps == 8) // greyscale image { -- 2.45.2