gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/tu_file.cpp server/stre...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/tu_file.cpp server/stre...
Date: Thu, 24 May 2007 22:31:14 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/24 22:31:14

Modified files:
        .              : ChangeLog 
        libbase        : tu_file.cpp 
        server         : stream.cpp 

Log message:
                * server/stream.cpp (open_tag): print end tag position in 
verbose
                  parse mode; (close_tag): assertion checking (shows a bug in
                  zlib_adapter, see bug #19931).
                * libbase/tu_file.cpp (std_seek_func): assertion checking and 
minor
                  cleanups.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3348&r2=1.3349
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_file.cpp?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/server/stream.cpp?cvsroot=gnash&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3348
retrieving revision 1.3349
diff -u -b -r1.3348 -r1.3349
--- ChangeLog   24 May 2007 22:27:09 -0000      1.3348
+++ ChangeLog   24 May 2007 22:31:13 -0000      1.3349
@@ -8,6 +8,11 @@
 
 2007-05-24 Sandro Santilli <address@hidden>
 
+       * server/stream.cpp (open_tag): print end tag position in verbose
+         parse mode; (close_tag): assertion checking (shows a bug in
+         zlib_adapter, see bug #19931).
+       * libbase/tu_file.cpp (std_seek_func): assertion checking and minor
+         cleanups.
        * libbase/curl_adapter.cpp (CurlStreamFile::seek): use the _cached
          member for checking wheter a seek will succeed or not (fseek
          allows you to seek past the end of the file otherwise).

Index: libbase/tu_file.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/tu_file.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- libbase/tu_file.cpp 14 May 2007 21:39:48 -0000      1.18
+++ libbase/tu_file.cpp 24 May 2007 22:31:13 -0000      1.19
@@ -57,6 +57,8 @@
 static int
 std_seek_func(int pos, void *appdata)
 {
+       GNASH_REPORT_FUNCTION;
+
     assert(appdata);
 
     // TODO: optimize this by caching total stream size ?
@@ -65,12 +67,17 @@
            return TU_FILE_SEEK_ERROR;
     }
 
-    clearerr((FILE*) appdata); // make sure EOF flag is cleared.
-    int        result = fseek((FILE*)appdata, pos, SEEK_SET);
+    FILE* file = static_cast<FILE*>(appdata);
+
+    clearerr(file); // make sure EOF flag is cleared.
+    int        result = fseek(file, pos, SEEK_SET);
     if (result == EOF) {
        // @@ TODO should set m_error to something relevant based on errno.
        return TU_FILE_SEEK_ERROR;
     }
+
+    assert ( ftell(file) == pos );
+
     return 0;
 }
 

Index: server/stream.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/stream.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/stream.cpp   15 May 2007 09:59:08 -0000      1.20
+++ server/stream.cpp   24 May 2007 22:31:14 -0000      1.21
@@ -289,15 +289,15 @@
                }
                _current_tag_length = tag_length;
 
-               IF_VERBOSE_PARSE (
-                       log_parse("SWF[%lu]: tag type = %d, tag length = %d",
-                       offset, tag_type, tag_length);
-               );
-                       
                // Remember where the end of the tag is, so we can
                // fast-forward past it when we're done reading it.
                m_tag_stack.push_back(get_position() + tag_length);
 
+               IF_VERBOSE_PARSE (
+                       log_parse("SWF[%lu]: tag type = %d, tag length = %d, 
end tag = %lu",
+                       offset, tag_type, tag_length, m_tag_stack.back());
+               );
+
                return static_cast<SWF::tag_type>(tag_type);
        }
 
@@ -307,7 +307,15 @@
                assert(m_tag_stack.size() > 0);
                unsigned long end_pos = m_tag_stack.back();
                m_tag_stack.pop_back();
-               m_input->set_position(end_pos);
+
+               if ( ! m_input->set_position(end_pos) )
+               {
+                       log_error("Could not seek to end position");
+               }
+               else
+               {
+                       assert(m_input->get_position() == end_pos);
+               }
 
                m_unused_bits = 0;
        }




reply via email to

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