aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-10-16 13:03:14 +0200
committerPierre Ossman <ossman@cendio.se>2015-10-16 13:03:14 +0200
commit1e61325deaf01771b661e3fa3fbe658ff6539147 (patch)
tree45cf1cac87c3232c196c565649ea4b86e8d90d7a
parentf4a971edf41032da98b4b00334be24f637e21540 (diff)
downloadtigervnc-1e61325deaf01771b661e3fa3fbe658ff6539147.tar.gz
tigervnc-1e61325deaf01771b661e3fa3fbe658ff6539147.zip
Flush entire JPEG buffer, ignoring state
libjpeg doesn't update the buffer state before calling the empty_output_buffer() callback so we need to flush everything, not just the apparent size.
-rw-r--r--common/rfb/JpegCompressor.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx
index 5df0039e..c8bf8410 100644
--- a/common/rfb/JpegCompressor.cxx
+++ b/common/rfb/JpegCompressor.cxx
@@ -94,7 +94,7 @@ JpegEmptyOutputBuffer(j_compress_ptr cinfo)
JPEG_DEST_MGR *dest = (JPEG_DEST_MGR *)cinfo->dest;
JpegCompressor *jc = dest->instance;
- jc->setptr(dest->pub.next_output_byte);
+ jc->setptr(jc->getend());
jc->overrun(jc->getend() - jc->getstart(), 1);
dest->pub.next_output_byte = jc->getptr();
dest->pub.free_in_buffer = jc->getend() - jc->getptr();