From 6778a872476db77a83e2885a22891fd3d32f1348 Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 20 Aug 2008 13:25:41 +0000 Subject: [PATCH] fixed cgi length bug --- lib/rfxswf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rfxswf.c b/lib/rfxswf.c index d75868d..c03a997 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -1296,13 +1296,14 @@ int swf_WriteSWF2(writer_t*writer, SWF * swf) // Writes SWF to file, return writer_t zwriter; int fileSize = 0; int inSprite = 0; - int writer_lastpos = 0; int ret; + writer_t*original_writer = writer; + int writer_lastpos = 0; if (!swf) return -1; if (!writer) return -1; // the caller should provide a nullwriter, not 0, for querying SWF size - if(writer) writer_lastpos = writer->pos; + if(original_writer) writer_lastpos = original_writer->pos; // Insert REFLEX Tag @@ -1435,7 +1436,7 @@ int swf_WriteSWF2(writer_t*writer, SWF * swf) // Writes SWF to file, return if(swf->compressed==1 || (swf->compressed==0 && swf->fileVersion>=6) || swf->compressed==8) { if(swf->compressed != 8) { zwriter.finish(&zwriter); - return writer->pos - writer_lastpos; + return original_writer->pos - writer_lastpos; } return (int)fileSize; } else { -- 1.7.10.4