gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/zlib_adapter.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/zlib_adapter.cpp
Date: Thu, 24 May 2007 23:29:37 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/24 23:29:37

Modified files:
        .              : ChangeLog 
        libbase        : zlib_adapter.cpp 

Log message:
                * libbase/zlib_adapter.cpp: fix seek function to respect
                  tu_file interface. Fix inflater to no set an error condition
                  when inflate() just needs more calls to complete the request.
                  Fixes bug #19931.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3349&r2=1.3350
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/zlib_adapter.cpp?cvsroot=gnash&r1=1.15&r2=1.16

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3349
retrieving revision 1.3350
diff -u -b -r1.3349 -r1.3350
--- ChangeLog   24 May 2007 22:31:13 -0000      1.3349
+++ ChangeLog   24 May 2007 23:29:36 -0000      1.3350
@@ -1,3 +1,10 @@
+2007-05-24 Sandro Santilli <address@hidden>
+
+       * libbase/zlib_adapter.cpp: fix seek function to respect
+         tu_file interface. Fix inflater to no set an error condition
+         when inflate() just needs more calls to complete the request.
+         Fixes bug #19931.
+
 2007-05-24 Tomas Groth Christensen <address@hidden>
 
        * libbase/LoadThread.{cpp,h}: Made the download loop sleep when

Index: libbase/zlib_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/zlib_adapter.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libbase/zlib_adapter.cpp    2 May 2007 18:19:02 -0000       1.15
+++ libbase/zlib_adapter.cpp    24 May 2007 23:29:36 -0000      1.16
@@ -10,6 +10,7 @@
 #include "zlib_adapter.h"
 #include "tu_file.h"
 #include "utility.h"
+#include "log.h"
 
 #include <memory>
 
@@ -83,7 +84,7 @@
 
                        int     err = inflateInit(&m_zstream);
                        if (err != Z_OK) {
-                               //log_error("error: inflater_impl::ctor() 
inflateInit() returned %d\n", err);
+                               gnash::log_error("inflater_impl::ctor() 
inflateInit() returned %d\n", err);
                                m_error = 1;
                                return;
                        }
@@ -100,6 +101,7 @@
                        m_at_eof = 0;
                        int     err = inflateReset(&m_zstream);
                        if (err != Z_OK) {
+                               gnash::log_error("inflater_impl::reset() 
inflateReset() returned %d\n", err);
                                m_error = 1;
                                return;
                        }
@@ -151,9 +153,17 @@
                                        m_at_eof = true;
                                        break;
                                }
+                               if (err == Z_BUF_ERROR)
+                               {
+                                       
//gnash::log_error("inflater_impl::inflate_from_stream() inflate() returned 
Z_BUF_ERROR");
+                                       // we should call inflate again... 
giving more input or output space !
+                                       //m_error = 1;
+                                       break;
+                               }
                                if (err != Z_OK)
                                {
                                        // something's wrong.
+                                       
gnash::log_error("inflater_impl::inflate_from_stream() inflate() returned %d", 
err);
                                        m_error = 1;
                                        break;
                                }
@@ -212,12 +222,14 @@
 
 
        int inflate_seek(int pos, void* appdata)
-       // Try to go to pos.  Return actual pos.
+       // Try to go to pos.  Return 0 on success or TU_FILE_SEEK_ERROR on 
error.
        {
                inflater_impl*  inf = (inflater_impl*) appdata;
                if (inf->m_error)
                {
-                       return inf->m_logical_stream_pos;
+                       gnash::log_debug("Inflater is in error condition");
+                       return TU_FILE_SEEK_ERROR;
+                       //return inf->m_logical_stream_pos;
                }
 
                // If we're seeking backwards, then restart from the beginning.
@@ -240,13 +252,16 @@
                        if (bytes_read == 0)
                        {
                                // Trouble; can't seek any further.
+                               gnash::log_debug("Trouble: can't seek any 
further.. ");
+                               return TU_FILE_SEEK_ERROR;
                                break;
                        }
                }
 
-               assert(inf->m_logical_stream_pos <= pos);
+               //assert(inf->m_logical_stream_pos <= pos);
+               assert(inf->m_logical_stream_pos == pos);
 
-               return inf->m_logical_stream_pos;
+               return 0; // inf->m_logical_stream_pos;
        }
 
 




reply via email to

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