[Spice-devel] [PATCH 2/2] server/mjpeg_encoder: fix wrong size assigned to dest_len

Yonit Halperin yhalperi at redhat.com
Thu May 10 04:09:05 PDT 2012


It should have been the allocated size and not the occupied one.
This led to a lot of unnecessary allocations and deallocations.
---
 server/mjpeg_encoder.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index 3c2fc31..6bb2f69 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -140,7 +140,7 @@ static void term_mem_destination(j_compress_ptr cinfo)
   mem_destination_mgr *dest = (mem_destination_mgr *) cinfo->dest;
 
   *dest->outbuffer = dest->buffer;
-  *dest->outsize = dest->bufsize - dest->pub.free_in_buffer;
+  *dest->outsize = dest->bufsize;
 }
 
 /*
-- 
1.7.7.6



More information about the Spice-devel mailing list