[X2Go-Commits] [x2gokdrive] 01/01: improve initialization of cursor frame and cache element structures.

git-admin at x2go.org git-admin at x2go.org
Thu Jul 22 17:32:52 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gokdrive.

commit d5e26ea37d6f613ba656dad34a77bd32d68da307
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date:   Thu Jul 22 10:32:39 2021 -0500

    improve initialization of cursor frame and cache element structures.
---
 debian/changelog   |  1 +
 x2gokdriveremote.c | 20 ++------------------
 2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7b23b31..521ae99 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,7 @@ x2gokdrive (0.0.0.1-0x2go1) UNRELEASED; urgency=medium
       RemoveNotifyFd) to main thread.
     - (re)enable sessions debugging.
     - fix infinite loop if reading of cookie has failed.
+    - improve initialization of cursor frame and cache element structures.
 
   [ Mihai Moldovan ]
   * Initial release:
diff --git a/x2gokdriveremote.c b/x2gokdriveremote.c
index f98c28e..2cdc104 100644
--- a/x2gokdriveremote.c
+++ b/x2gokdriveremote.c
@@ -258,11 +258,9 @@ void remote_sendCursor(CursorPtr cursor)
     BOOL cursorSent=FALSE;
 //    #warning check memory
     struct cursorFrame* cframe=malloc(sizeof(struct cursorFrame));
+    bzero(cframe, sizeof(struct cursorFrame));
 
     cframe->serialNumber=cursor->serialNumber;
-    cframe->size=0;
-    cframe->data=0;
-    cframe->next=0;
 
 
     pthread_mutex_lock(&remoteVars.sendqueue_mutex);
@@ -2920,7 +2918,6 @@ unsigned char* jpeg_compress (int quality, uint32_t image_width, uint32_t image_
         cinfo.in_color_space = JCS_EXT_BGR;     /* colorspace of input image */
     jpeg_set_defaults(&cinfo);
     jpeg_set_quality(&cinfo, quality, TRUE); /* limit to baseline-JPEG values */
-
     jpeg_start_compress(&cinfo, TRUE);
     row_stride = image_width * bpp;            /* JSAMPLEs per row in image_buffer */
 
@@ -2968,23 +2965,10 @@ static
 struct cache_elem* add_cache_element(uint32_t crc, int32_t dx, int32_t dy, uint32_t size, uint32_t width, uint32_t height)
 {
     struct cache_elem* el=malloc(sizeof(struct cache_elem));
-    el->next=0;
+    bzero(el, sizeof(struct cache_elem));
     el->crc=crc;
-    el->sent=FALSE;
-    el->busy=0;
-    el->rval=el->bval=el->gval=0;
     el->width=width;
     el->height=height;
-    el->source=0;
-
-
-    for(int i=0;i<9;++i)
-    {
-        el->regions[i].compressed_data=0;
-        el->regions[i].size=0;
-        el->regions[i].source_crc=0;
-        el->regions[i].rect.size.width=0;
-    }
 
 //    if(CACHEBPP==4)
 //    {

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdrive.git


More information about the x2go-commits mailing list