gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/stream.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/stream.h
Date: Wed, 01 Aug 2007 20:28:00 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/08/01 20:28:00

Modified files:
        .              : ChangeLog 
        server         : stream.h 

Log message:
                * server/stream.h: add ensureBytes() method to verify
                  SWF integrity.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3902&r2=1.3903
http://cvs.savannah.gnu.org/viewcvs/gnash/server/stream.h?cvsroot=gnash&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3902
retrieving revision 1.3903
diff -u -b -r1.3902 -r1.3903
--- ChangeLog   1 Aug 2007 18:57:02 -0000       1.3902
+++ ChangeLog   1 Aug 2007 20:28:00 -0000       1.3903
@@ -1,5 +1,10 @@
 2007-08-01 Sandro Santilli <address@hidden>
 
+       * server/stream.h: add ensureBytes() method to verify
+         SWF integrity.
+
+2007-08-01 Sandro Santilli <address@hidden>
+
        * server/swf/tag_loaders.cpp: (define_sound_loader) check if number of
          samples exceed available bytes in the tag. (sound_expand) assertion
          checking. (u8_expand) use a scoped_array in the easy case (we'll

Index: server/stream.h
===================================================================
RCS file: /sources/gnash/gnash/server/stream.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/stream.h     15 May 2007 13:48:37 -0000      1.20
+++ server/stream.h     1 Aug 2007 20:28:00 -0000       1.21
@@ -12,6 +12,8 @@
 #include "container.h"
 #include "swf.h"
 #include "tu_config.h"
+#include "GnashException.h"
+
 #include <string>
 
 class tu_file;
@@ -155,6 +157,22 @@
                        set_position(get_tag_end_position());
                }
 
+               /// \brief
+               /// Ensure the requested number of bytes are available in the
+               /// currently opened tag.
+               //
+               /// Throws an exception on a short count.
+               /// This method should be called before any attempt to read
+               /// fields from the SWF.
+               ///
+               void ensureBytes(unsigned long needed)
+               {
+                       if ( get_tag_end_position() - get_position() < needed )
+                       {
+                               throw ParserException("premature end of tag");
+                       }
+               }
+
        private:
                // should this be long ?
                unsigned _current_tag_length;




reply via email to

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