From 0cd533cf7f53daa157a9b7f6af2b9b72eeca5403 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 19 May 2020 21:24:58 +0200 Subject: [PATCH] Remove special functions from JPEG compressor We can do what we want with the standard methods. --- common/rfb/JpegCompressor.cxx | 2 +- common/rfb/JpegCompressor.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx index 4cb35a47..5cc3855d 100644 --- a/common/rfb/JpegCompressor.cxx +++ b/common/rfb/JpegCompressor.cxx @@ -95,7 +95,7 @@ JpegEmptyOutputBuffer(j_compress_ptr cinfo) JpegCompressor *jc = dest->instance; jc->setptr(jc->getend()); - jc->overrun(jc->getend() - jc->getstart()); + jc->check(jc->length()); dest->pub.next_output_byte = jc->getptr(); dest->pub.free_in_buffer = jc->avail(); diff --git a/common/rfb/JpegCompressor.h b/common/rfb/JpegCompressor.h index ab0f9f85..de201732 100644 --- a/common/rfb/JpegCompressor.h +++ b/common/rfb/JpegCompressor.h @@ -47,12 +47,6 @@ namespace rfb { void writeBytes(const void*, int); - inline rdr::U8* getstart() { return start; } - - inline virtual void overrun(int needed) { - return MemOutStream::overrun(needed); - } - private: struct jpeg_compress_struct *cinfo; -- 2.39.5