[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/GnashException.h server...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/GnashException.h server... |
Date: |
Wed, 29 Nov 2006 23:54:06 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/11/29 23:54:05
Modified files:
. : ChangeLog
libbase : GnashException.h
server : styles.cpp
server/parser : movie_def_impl.cpp
Log message:
* server/parser/movie_def_impl.cpp (read_all_swf):
catch std exceptions (including parsing exceptions).
* server/styles.cpp (read): throw ParserException when
an unsupported fill style type is read.
* libbase/GnashException.h: add a ParserException class.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1824&r2=1.1825
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/GnashException.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.48&r2=1.49
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1824
retrieving revision 1.1825
diff -u -b -r1.1824 -r1.1825
--- ChangeLog 29 Nov 2006 23:20:17 -0000 1.1824
+++ ChangeLog 29 Nov 2006 23:54:05 -0000 1.1825
@@ -1,5 +1,10 @@
2006-11-30 Sandro Santilli <address@hidden>
+ * server/parser/movie_def_impl.cpp (read_all_swf):
+ catch std exceptions (including parsing exceptions).
+ * server/styles.cpp (read): throw ParserException when
+ an unsupported fill style type is read.
+ * libbase/GnashException.h: add a ParserException class.
* backend/Makefile.am: add BOOST_CFLAGS (see bug #18398)
2006-11-29 Patrice Dumas <address@hidden>
Index: libbase/GnashException.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/GnashException.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libbase/GnashException.h 29 Oct 2006 18:34:11 -0000 1.3
+++ libbase/GnashException.h 29 Nov 2006 23:54:05 -0000 1.4
@@ -50,6 +50,26 @@
std::string _msg;
};
+/// An SWF parsing exception
+class ParserException: public GnashException
+{
+
+public:
+
+ ParserException(const std::string& s)
+ :
+ GnashException(s)
+ {}
+
+ ParserException()
+ :
+ GnashException("Parser error")
+ {}
+
+ virtual ~ParserException() throw() {}
+
+};
+
} // namespace gnash
#endif // def _GNASH_GNASHEXCEPTION__H
Index: server/styles.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/styles.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/styles.cpp 28 Nov 2006 16:47:33 -0000 1.25
+++ server/styles.cpp 29 Nov 2006 23:54:05 -0000 1.26
@@ -13,6 +13,7 @@
#include "stream.h"
#include "movie_definition.h"
#include "swf.h"
+#include "GnashException.h"
namespace gnash {
@@ -193,7 +194,7 @@
log_error("Unsupported fill style type: 0x%X", m_type);
// This is a fatal error, we'll be leaving the stream
// read pointer in an unknown position.
- assert(0);
+ throw ParserException("Unsupported fill style");
}
}
Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/parser/movie_def_impl.cpp 28 Nov 2006 12:30:42 -0000 1.48
+++ server/parser/movie_def_impl.cpp 29 Nov 2006 23:54:05 -0000 1.49
@@ -33,6 +33,7 @@
#include "swf/TagLoadersTable.h"
#include "movie_root.h"
#include "VM.h" // for assertions
+#include "GnashException.h" // for parser exception
#include <string>
#include <unistd.h>
@@ -124,6 +125,7 @@
{
movie_def_impl* md = static_cast<movie_def_impl*>(arg);
md->read_all_swf();
+
// maybe this frees all resources and that's bad !
//pthread_exit(NULL);
@@ -936,6 +938,8 @@
stream &str = *_str;
+ try {
+
//size_t it=0;
while ( (uint32_t) str.get_position() < _swf_end_pos )
{
@@ -1007,6 +1011,16 @@
_loader.unlock();
}
+ } catch (const std::exception& e) {
+ // FIXME: we should be setting some variable
+ // so that it is possible for clients
+ // to check the parser status
+ // Also, we should probably call _loader.unlock()
+ // and make sure any wait_for_frame call is
+ // released (condition set and false result)
+ log_error("Parsing exception: %s", e.what());
+ }
+
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libbase/GnashException.h server...,
Sandro Santilli <=