Fixed a problem with copying discontinuous pixel data to IRIX JPEG ompressor.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2335 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/IrixDMJpegCompressor.cxx b/common/rfb/IrixDMJpegCompressor.cxx
index 57e8aa8..dda059f 100644
--- a/common/rfb/IrixDMJpegCompressor.cxx
+++ b/common/rfb/IrixDMJpegCompressor.cxx
@@ -79,8 +79,9 @@
if (!m_ic.allocBuffer(&srcBuf, m_srcPool)) {
return;
}
- // FIXME: Currently, copyToBuffer() copies parts of the image incorrectly.
- if (!m_ic.copyToBuffer(srcBuf, buf, w * h * (fmt->bpp / 8))) {
+ int widthInBytes = w * (fmt->bpp / 8);
+ int strideInBytes = stride * (fmt->bpp / 8);
+ if (!m_ic.copyToBuffer(srcBuf, buf, widthInBytes, h, strideInBytes)) {
m_ic.freeBuffer(srcBuf);
return;
}