|
|
8b1cd8 |
diff -up tigervnc-1.3.0/common/rfb/ZRLEEncoder.cxx.zrle-crash tigervnc-1.3.0/common/rfb/ZRLEEncoder.cxx
|
|
|
8b1cd8 |
--- tigervnc-1.3.0/common/rfb/ZRLEEncoder.cxx.zrle-crash 2013-07-01 13:41:59.000000000 +0100
|
|
|
8b1cd8 |
+++ tigervnc-1.3.0/common/rfb/ZRLEEncoder.cxx 2013-12-12 17:30:48.510007365 +0000
|
|
|
8b1cd8 |
@@ -55,16 +55,19 @@ Encoder* ZRLEEncoder::create(SMsgWriter*
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
|
|
|
8b1cd8 |
ZRLEEncoder::ZRLEEncoder(SMsgWriter* writer_)
|
|
|
8b1cd8 |
- : writer(writer_), zos(0,0,zlibLevel)
|
|
|
8b1cd8 |
+ : writer(writer_)
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
if (sharedMos)
|
|
|
8b1cd8 |
mos = sharedMos;
|
|
|
8b1cd8 |
else
|
|
|
8b1cd8 |
mos = new rdr::MemOutStream(129*1024);
|
|
|
8b1cd8 |
+
|
|
|
8b1cd8 |
+ zos = new rdr::ZlibOutStream(0, 0, zlibLevel);
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
|
|
|
8b1cd8 |
ZRLEEncoder::~ZRLEEncoder()
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
+ delete zos;
|
|
|
8b1cd8 |
if (!sharedMos)
|
|
|
8b1cd8 |
delete mos;
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
@@ -78,10 +81,10 @@ bool ZRLEEncoder::writeRect(const Rect&
|
|
|
8b1cd8 |
|
|
|
8b1cd8 |
switch (writer->bpp()) {
|
|
|
8b1cd8 |
case 8:
|
|
|
8b1cd8 |
- wroteAll = zrleEncode8(r, mos, &zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
+ wroteAll = zrleEncode8(r, mos, zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
break;
|
|
|
8b1cd8 |
case 16:
|
|
|
8b1cd8 |
- wroteAll = zrleEncode16(r, mos, &zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
+ wroteAll = zrleEncode16(r, mos, zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
break;
|
|
|
8b1cd8 |
case 32:
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
@@ -94,16 +97,16 @@ bool ZRLEEncoder::writeRect(const Rect&
|
|
|
8b1cd8 |
if ((fitsInLS3Bytes && pf.isLittleEndian()) ||
|
|
|
8b1cd8 |
(fitsInMS3Bytes && pf.isBigEndian()))
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
- wroteAll = zrleEncode24A(r, mos, &zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
+ wroteAll = zrleEncode24A(r, mos, zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
else if ((fitsInLS3Bytes && pf.isBigEndian()) ||
|
|
|
8b1cd8 |
(fitsInMS3Bytes && pf.isLittleEndian()))
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
- wroteAll = zrleEncode24B(r, mos, &zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
+ wroteAll = zrleEncode24B(r, mos, zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
else
|
|
|
8b1cd8 |
{
|
|
|
8b1cd8 |
- wroteAll = zrleEncode32(r, mos, &zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
+ wroteAll = zrleEncode32(r, mos, zos, imageBuf, maxLen, actual, ig);
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
break;
|
|
|
8b1cd8 |
}
|
|
|
8b1cd8 |
diff -up tigervnc-1.3.0/common/rfb/ZRLEEncoder.h.zrle-crash tigervnc-1.3.0/common/rfb/ZRLEEncoder.h
|
|
|
8b1cd8 |
--- tigervnc-1.3.0/common/rfb/ZRLEEncoder.h.zrle-crash 2013-07-01 13:42:01.000000000 +0100
|
|
|
8b1cd8 |
+++ tigervnc-1.3.0/common/rfb/ZRLEEncoder.h 2013-12-12 17:30:48.510007365 +0000
|
|
|
8b1cd8 |
@@ -45,7 +45,7 @@ namespace rfb {
|
|
|
8b1cd8 |
private:
|
|
|
8b1cd8 |
ZRLEEncoder(SMsgWriter* writer);
|
|
|
8b1cd8 |
SMsgWriter* writer;
|
|
|
8b1cd8 |
- rdr::ZlibOutStream zos;
|
|
|
8b1cd8 |
+ rdr::ZlibOutStream* zos;
|
|
|
8b1cd8 |
rdr::MemOutStream* mos;
|
|
|
8b1cd8 |
static rdr::MemOutStream* sharedMos;
|
|
|
8b1cd8 |
static int maxLen;
|