[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r10051: don't try to convert an empty
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r10051: don't try to convert an empty property to an as_value. |
Date: |
Thu, 26 Mar 2009 13:18:28 -0600 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10051
committer: address@hidden
branch nick: rtmp
timestamp: Thu 2009-03-26 13:18:28 -0600
message:
don't try to convert an empty property to an as_value.
modified:
libcore/as_value.cpp
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp 2009-03-26 16:46:55 +0000
+++ b/libcore/as_value.cpp 2009-03-26 19:18:28 +0000
@@ -61,7 +61,7 @@
#define GNASH_DEBUG_SOFT_REFERENCES
// Define this macro to make AMF parsing verbose
-// #define GNASH_DEBUG_AMF_DESERIALIZE 1
+#define GNASH_DEBUG_AMF_DESERIALIZE 1
// Define this macto to make AMF writing verbose
// #define GNASH_DEBUG_AMF_SERIALIZE 1
@@ -1861,10 +1861,12 @@
:
m_type(UNDEFINED)
{
+// GNASH_REPORT_FUNCTION;
// el.dump();
+
VM& vm = VM::get();
string_table& st = vm.getStringTable();
-
+
switch (el.getType()) {
case amf::Element::NOTYPE:
{
@@ -1935,7 +1937,7 @@
str = el.getName();
}
- set_string(str);
+ set_string(str);
break;
}
@@ -1945,18 +1947,22 @@
#ifdef GNASH_DEBUG_AMF_DESERIALIZE
log_debug("as_value(Element&) : AMF type OBJECT");
#endif
- as_object* obj = new as_object(getObjectInterface());
+ as_object* obj = new as_object(getObjectInterface());
if (el.propertySize()) {
for (size_t i=0; i < el.propertySize(); i++) {
const boost::shared_ptr<amf::Element> prop =
el.getProperty(i);
if (prop == 0) {
break;
} else {
- obj->set_member(st.find(prop->getName()),
as_value(*prop));
+ if (prop->getNameSize() == 0) {
+ log_debug("%s:(%d) Property has no name!",
__PRETTY_FUNCTION__, __LINE__);
+ } else {
+ obj->set_member(st.find(prop->getName()),
as_value(*prop));
+ }
}
}
}
- set_as_object(obj);
+ set_as_object(obj);
break;
}
@@ -1972,12 +1978,12 @@
Array_as* obj = new Array_as;
if (el.propertySize()) {
for (size_t i=0; i < el.propertySize(); i++) {
- const boost::shared_ptr<amf::Element> prop = el.getProperty(i);
- if (prop == 0) {
- break;
- } else {
- obj->set_member(st.find(prop->getName()), as_value(*prop));
- }
+ const boost::shared_ptr<amf::Element> prop =
el.getProperty(i);
+ if (prop == 0) {
+ break;
+ } else {
+ obj->set_member(st.find(prop->getName()),
as_value(*prop));
+ }
}
}
set_as_object(obj);
@@ -1999,7 +2005,11 @@
if (prop == 0) {
break;
} else {
- obj->set_member(st.find(prop->getName()), as_value(*prop));
+ if (prop->getNameSize() == 0) {
+ log_debug("%s:(%d) Property has no name!",
__PRETTY_FUNCTION__, __LINE__);
+ } else {
+ obj->set_member(st.find(prop->getName()),
as_value(*prop));
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r10051: don't try to convert an empty property to an as_value.,
rob <=