diff options
author | dscho <dscho> | 2005-05-23 19:59:59 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-05-23 19:59:59 +0000 |
commit | 1b830d0446f075ac1f76d47d11b08d1bc85ab98b (patch) | |
tree | d6256bd02c2be82fdd04c0a86cf8dac3f635deff | |
parent | 53387007bac1479ccbea469b842608550de95811 (diff) | |
download | libtdevnc-1b830d0446f075ac1f76d47d11b08d1bc85ab98b.tar.gz libtdevnc-1b830d0446f075ac1f76d47d11b08d1bc85ab98b.zip |
init a structure *before* using it...
-rw-r--r-- | libvncclient/tight.c | 3 | ||||
-rw-r--r-- | libvncclient/vncviewer.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libvncclient/tight.c b/libvncclient/tight.c index 7baac3a..348c423 100644 --- a/libvncclient/tight.c +++ b/libvncclient/tight.c @@ -622,7 +622,6 @@ JpegInitSource(j_decompress_ptr cinfo) { rfbClient* client=(rfbClient*)cinfo->client_data; client->jpegError = FALSE; - client->jpegSrcManager = malloc(sizeof(struct jpeg_source_mgr)); } static boolean @@ -665,6 +664,8 @@ JpegSetSrcManager(j_decompress_ptr cinfo, client->jpegBufferPtr = compressedData; client->jpegBufferLen = (size_t)compressedLen; + if(client->jpegSrcManager == NULL) + client->jpegSrcManager = malloc(sizeof(struct jpeg_source_mgr)); client->jpegSrcManager->init_source = JpegInitSource; client->jpegSrcManager->fill_input_buffer = JpegFillInputBuffer; client->jpegSrcManager->skip_input_data = JpegSkipInputData; diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 2927b74..12c801b 100644 --- a/libvncclient/vncviewer.c +++ b/libvncclient/vncviewer.c @@ -161,6 +161,7 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, #ifdef LIBVNCSERVER_HAVE_LIBJPEG memset(client->zlibStreamActive,0,sizeof(rfbBool)*4); + client->jpegSrcManager = NULL; #endif client->HandleCursorPos = DummyPoint; |