gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash libamf/sol.cpp ChangeLog


From: Rob Savoye
Subject: [Gnash-commit] gnash libamf/sol.cpp ChangeLog
Date: Sat, 05 Jan 2008 01:28:34 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    08/01/05 01:28:34

Modified files:
        libamf         : sol.cpp 
        .              : ChangeLog 

Log message:
                * libamf/sol.cpp: Properly caluculate the filesize.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/sol.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5301&r2=1.5302

Patches:
Index: libamf/sol.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/sol.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- libamf/sol.cpp      31 Dec 2007 05:53:34 -0000      1.11
+++ libamf/sol.cpp      5 Jan 2008 01:28:34 -0000       1.12
@@ -75,7 +75,7 @@
     vector<amf::Element *>::iterator it;
     for (it = _amfobjs.begin(); it != _amfobjs.end(); it++) {
        amf::Element *el = (*(it));
-       delete el;
+//     delete el;
     }
 }
 
@@ -217,14 +217,20 @@
     vector<amf::Element *>::iterator ita; 
     AMF amf_obj;
     char *ptr;
-
+    int size = 0;
     
     if (filespec.size() == 0) {
        return false;
     }
     
-    char *body = new char[_filesize + 16];
-    memset(body, 0, _filesize);
+    for (ita = _amfobjs.begin(); ita != _amfobjs.end(); ita++) {
+        amf::Element *el = (*(ita));
+       size += el->getName().size() + el->getLength() + 5;
+    }
+    _filesize = size;
+    
+    char *body = new char[size + 20];
+    memset(body, 0, size);
     ptr = body;
     
     for (ita = _amfobjs.begin(); ita != _amfobjs.end(); ita++) {

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5301
retrieving revision 1.5302
diff -u -b -r1.5301 -r1.5302
--- ChangeLog   5 Jan 2008 01:27:00 -0000       1.5301
+++ ChangeLog   5 Jan 2008 01:28:34 -0000       1.5302
@@ -1,3 +1,7 @@
+2008-01-04  Rob Savoye  <address@hidden>
+
+       * libamf/sol.cpp: Properly caluculate the filesize.
+
 2008-01-04 Sandro Santilli <address@hidden>
 
        * plugin/Makefile.am: drop useless install/uninstall rules,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]