[PATCH spice-common RFC] Fix linearization of several marshallers with one item

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The linearization optimization that avoids copying only one item must
check that there are no further marshallers in the chain.
---
 common/marshaller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/marshaller.c b/common/marshaller.c
index bd012d7..0c6680e 100644
--- a/common/marshaller.c
+++ b/common/marshaller.c
@@ -419,7 +419,7 @@ uint8_t *spice_marshaller_linearize(SpiceMarshaller *m, size_t skip_bytes,
     /* Only supported for root marshaller */
     assert(m->data->marshallers == m);
 
-    if (m->n_items == 1) {
+    if (m->n_items == 1 && m->next == NULL) {
         *free_res = FALSE;
         if (m->items[0].len <= skip_bytes) {
             *len = 0;
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]