From: Pierre Ossman Date: Fri, 16 Oct 2015 11:03:14 +0000 (+0200) Subject: Flush entire JPEG buffer, ignoring state X-Git-Tag: v1.5.90~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1e61325deaf01771b661e3fa3fbe658ff6539147;p=tigervnc.git 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. --- 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();