gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp
Date: Tue, 06 Mar 2007 10:22:18 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/03/06 10:22:18

Modified files:
        .              : ChangeLog 
        server/vm      : ASHandlers.cpp 

Log message:
        * server/vm/ASHandlers.cpp (ActionWith): survive empty 'with' blocks.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2547&r2=1.2548
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.51&r2=1.52

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2547
retrieving revision 1.2548
diff -u -b -r1.2547 -r1.2548
--- ChangeLog   6 Mar 2007 10:16:04 -0000       1.2547
+++ ChangeLog   6 Mar 2007 10:22:18 -0000       1.2548
@@ -1,6 +1,7 @@
 2007-03-06 Sandro Santilli <address@hidden>
 
-       * testsuite/actionscript.all/with.as: test empty with block.
+       * server/vm/ASHandlers.cpp (ActionWith): survive empty 'with' blocks.
+       * testsuite/actionscript.all/with.as: test empty 'with' block.
 
 2007-03-06 Udo Giacomozzi <address@hidden>
 

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- server/vm/ASHandlers.cpp    6 Mar 2007 08:31:21 -0000       1.51
+++ server/vm/ASHandlers.cpp    6 Mar 2007 10:22:18 -0000       1.52
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ASHandlers.cpp,v 1.51 2007/03/06 08:31:21 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.52 2007/03/06 10:22:18 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3115,18 +3115,30 @@
        ++pc; // skip tag code
 
        int tag_length = code.read_int16(pc); // read tag len (should be 2)
-       assert(tag_length == 2); // or SWF is malformed !
+       if ( tag_length != 2 )
+       {
+               IF_VERBOSE_MALFORMED_SWF(
+               log_swferror("ActionWith tag length != 2 - skipping");
+               );
+               return;
+       }
        pc += 2; // skip tag len
 
-       int block_length = code.read_int16(pc); // read 'with' body size
-       assert(block_length > 0);
+       unsigned block_length = code.read_int16(pc); // read 'with' body size
+       if ( block_length == 0 )
+       {
+               IF_VERBOSE_ASCODING_ERRORS(
+               log_aserror("Empty with() block...");
+               );
+               return;
+       }
        pc += 2; // skip with body size
 
        // now we should be on the first action of the 'with' body
        assert(thread.next_pc == pc);
 
        // where does the 'with' block ends ?
-       int block_end = thread.next_pc + block_length;
+       unsigned block_end = thread.next_pc + block_length;
 
        if ( ! thread.pushWithEntry(with_stack_entry(with_obj, block_end)) )
        {




reply via email to

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