From: enikey Date: Fri, 19 Dec 2008 09:19:59 +0000 (+0000) Subject: [BugFix] Decoder zlibDecoder was not created in constructor VncCanvas and application... X-Git-Tag: v0.0.90~248 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4582bab2f2cbf744a0cb7da17b38d424b15444ea;p=tigervnc.git [BugFix] Decoder zlibDecoder was not created in constructor VncCanvas and application falls with NullPointerException when it tries to set session recorder for this decoder. [Developement] Decoders updates their params (framebuffer size and bpp) in updateFramebufferSize method. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3436 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java index 4cd82af2..51761c09 100644 --- a/java/src/com/tightvnc/vncviewer/VncCanvas.java +++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java @@ -164,6 +164,7 @@ class VncCanvas extends Canvas correDecoder = new CoRREDecoder(memGraphics, rfbis); hextileDecoder = new HextileDecoder(memGraphics, rfbis); tightDecoder = new TightDecoder(memGraphics, rfbis); + zlibDecoder = new ZlibDecoder(memGraphics, rfbis); zrleDecoder = new ZRLEDecoder(memGraphics, rfbis); // @@ -379,6 +380,32 @@ class VncCanvas extends Canvas } } + // + // Update decoders + // + + // + // FIXME: Why decoders can be null here? + // + + if (decoders != null) { + for (int i = 0; i < decoders.length; i++) { + // + // Set changes to every decoder that we can use + // + + decoders[i].setBPP(bytesPixel); + decoders[i].setFrameBufferSize(fbWidth, fbHeight); + decoders[i].setGraphics(memGraphics); + + // + // Update decoder + // + + decoders[i].update(); + } + } + // Images with raw pixels should be re-allocated on every change // of geometry or pixel format. if (bytesPixel == 1) {