Commit 1b830d04 authored by dscho's avatar dscho

init a structure *before* using it...

parent 53387007
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment