From c211774422455802299545b19ffdffd9496fdc31 Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Thu, 10 May 2012 14:01:39 +0300 Subject: [PATCH] server/mjpeg_encoder: fix wrong size assigned to dest_len 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c index 3c2fc31c..6bb2f699 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; } /*