gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp
Date: Fri, 08 Feb 2008 18:38:34 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/08 18:38:34

Modified files:
        .              : ChangeLog 
        server/swf     : tag_loaders.cpp 

Log message:
        (import_loader): read strings into a std::string rather then a temp 
newly
        allocated char[].  (fixes attempts to construct a string from a null).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5595&r2=1.5596
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.181&r2=1.182

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5595
retrieving revision 1.5596
diff -u -b -r1.5595 -r1.5596
--- ChangeLog   8 Feb 2008 15:57:02 -0000       1.5595
+++ ChangeLog   8 Feb 2008 18:38:33 -0000       1.5596
@@ -1,3 +1,9 @@
+2008-02-08 Sandro Santilli <address@hidden>
+
+       * server/swf/tag_loaders.cpp (import_loader): read strings into
+         a std::string rather then a temp newly allocated char[].
+         (fixes attempts to construct a string from a null).
+
 2008-02-08 Bastiaan Jacques <address@hidden>
 
        * libmedia/gst/SoundGst.cpp: Fix typo.

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- server/swf/tag_loaders.cpp  28 Jan 2008 20:36:29 -0000      1.181
+++ server/swf/tag_loaders.cpp  8 Feb 2008 18:38:34 -0000       1.182
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: tag_loaders.cpp,v 1.181 2008/01/28 20:36:29 strk Exp $ */
+/* $Id: tag_loaders.cpp,v 1.182 2008/02/08 18:38:34 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "gnashconfig.h"
@@ -1028,7 +1028,8 @@
 {
     assert(tag == SWF::IMPORTASSETS || tag == SWF::IMPORTASSETS2);
 
-    char* source_url = in->read_string();
+    std::string source_url;
+    in->read_string(source_url);
 
     // Resolve relative urls against baseurl
     URL abs_url(source_url, get_base_url());
@@ -1046,7 +1047,7 @@
 
     IF_VERBOSE_PARSE
     (
-       log_parse(_("  import: version = %u, source_url = %s (%s), count = 
%d"), import_version, abs_url.str().c_str(), source_url, count);
+       log_parse(_("  import: version = %u, source_url = %s (%s), count = 
%d"), import_version, abs_url.str().c_str(), source_url.c_str(), count);
     );
 
 
@@ -1083,15 +1084,16 @@
     for (int i = 0; i < count; i++)
     {
        boost::uint16_t id = in->read_u16();
-       char*   symbol_name = in->read_string();
+       std::string symbol_name;
+       in->read_string(symbol_name);
        IF_VERBOSE_PARSE
        (
-           log_parse(_("  import: id = %d, name = %s"), id, symbol_name);
+           log_parse(_("  import: id = %d, name = %s"), id, 
symbol_name.c_str());
        );
 
        if (s_no_recurse_while_loading)
        {
-           m->add_import(source_url, id, symbol_name);
+           m->add_import(source_url, id, symbol_name.c_str()); // TODO: pass 
the const ref of string instead
        }
        else
        {
@@ -1099,11 +1101,11 @@
            // s_no_recurse_while_loading, change
            // create_movie().
 
-           boost::intrusive_ptr<resource> res = 
source_movie->get_exported_resource(symbol_name);
+           boost::intrusive_ptr<resource> res = 
source_movie->get_exported_resource(symbol_name.c_str()); // TODO: pass const 
string&
            if (res == NULL)
            {
                log_error(_("import error: could not find resource '%s' in 
movie '%s'"),
-                         symbol_name, source_url);
+                         symbol_name.c_str(), source_url.c_str());
            }
            else if (font* f = res->cast_to_font())
            {
@@ -1118,14 +1120,12 @@
            else
            {
                log_error(_("import error: resource '%s' from movie '%s' has 
unknown type"),
-                         symbol_name, source_url);
+                         symbol_name.c_str(), source_url.c_str());
            }
        }
 
-       delete [] symbol_name;
     }
 
-    delete [] source_url;
 }
 
 // Read a DefineText tag.




reply via email to

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