[Spice-commits] 3 commits - common/canvas_base.c common/marshaller.c python_modules/marshal.py

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 27 20:45:07 UTC 2018


 common/canvas_base.c      |    2 +-
 common/marshaller.c       |    6 ++++++
 python_modules/marshal.py |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit bc9df5816210efbe15ca03e82510f34174784082
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Jun 21 22:55:08 2018 +0100

    marshal: Fix a bug with zero attribute
    
    If this attribute was specified during marshaller the field was
    marshalled twice.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index fd3416a..94ff055 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -321,7 +321,7 @@ def write_member_marshaller(writer, container, member, src, scope):
     elif t.is_primitive():
         if member.has_attr("zero"):
             writer.statement("spice_marshaller_add_%s(m, 0)" % (t.primitive_type()))
-        if member.has_attr("bytes_count"):
+        elif member.has_attr("bytes_count"):
             var = "%s__ref" % member.name
             scope.variable_def("void *", var)
             writer.statement("%s = spice_marshaller_add_%s(m, %s)" % (var, t.primitive_type(), 0))
commit 1378d5cfc4751afba401d30c9dd38a561fa39297
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Sun Dec 24 13:21:04 2017 +0000

    canvas_base: Make sure top_down is a boolean
    
    Should be a 0/1 but just in case make sure.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 62c458d..6bf6e5d 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -529,7 +529,7 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
     width = image->descriptor.width;
     stride_encoded = width;
     height = image->descriptor.height;
-    top_down = *(data++);
+    top_down = !!*(data++);
     spice_format = *(data++);
     switch (spice_format) {
         case SPICE_BITMAP_FMT_16BIT:
commit 16deca6f1c5ccecc28fc2e381b20fff8a421088f
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon May 14 09:24:00 2018 +0100

    marshaller: Fix a possible leak
    
    The possible file descriptor associated to the message (currently
    can be only the DRM descriptor from Virgl) is not freed in case
    the marshaller is reset/destroyed.
    This can happen connecting/disconnecting client.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/common/marshaller.c b/common/marshaller.c
index b55b568..0b45523 100644
--- a/common/marshaller.c
+++ b/common/marshaller.c
@@ -210,6 +210,12 @@ void spice_marshaller_reset(SpiceMarshaller *m)
     m->next = NULL;
     m->n_items = 0;
     m->total_size = 0;
+    if (m->has_fd) {
+        m->has_fd = false;
+        if (m->fd != -1) {
+            close(m->fd);
+        }
+    }
 
     d = m->data;
     d->last_marshaller = d->marshallers;


More information about the Spice-commits mailing list