From: Dimitri Schoolwerth Date: Sun, 28 Aug 2011 22:44:04 +0000 (+0000) Subject: Fixed copying only 1/3 of scanline when saving TIFF image in rare cases. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a000de7794cb20bdd772e76dda87baa27642056b?ds=sidebyside 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 --- 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 {