Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 115
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160828.1727 +Version: 0.7.2.99+git20160904.1650 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -186,7 +186,11 @@ { assert_and_throw(implEnable); - return _MR(abstract_s(getSystemState(),getNameAt(index-1))); + const tiny_string& name = getNameAt(index-1); + // not mentioned in the specs, but Adobe seems to convert string names to Integers, if possible + if (Array::isIntegerWithoutLeadingZeros(name)) + return _MR(abstract_i(getSystemState(),Integer::stringToASInteger(name.raw_buf(), 0))); + return _MR(abstract_s(getSystemState(),name)); } _R<ASObject> ASObject::nextValue(uint32_t index)
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -1770,7 +1770,7 @@ uint16_t version; if(!message->readShort(version)) return; - assert_and_throw(version==0x0); + message->setCurrentObjectEncoding(version == 3 ? ObjectEncoding::AMF3 : ObjectEncoding::AMF0); uint16_t numHeaders; if(!message->readShort(numHeaders)) return; @@ -1796,9 +1796,13 @@ return; uint8_t marker; - if(!message->readByte(marker)) + if(!message->peekByte(marker)) return; - assert_and_throw(marker==0x11); + if (marker == 0x11 && message->getCurrentObjectEncoding() != ObjectEncoding::AMF3) // switch to AMF3 + { + message->setCurrentObjectEncoding(ObjectEncoding::AMF3); + message->readByte(marker); + } _R<ASObject> obj=_MR(ByteArray::readObject(message.getPtr(), NULL, 0)); @@ -1824,38 +1828,44 @@ uint16_t numMessage; if(!message->readShort(numMessage)) return; - assert_and_throw(numMessage==1); - - tiny_string target; - if(!message->readUTF(target)) - return; - tiny_string response; - if(!message->readUTF(response)) - return; - - //TODO: Really use the response to map request/responses and detect errors - uint32_t objLen; - if(!message->readUnsignedInt(objLen)) - return; - uint8_t marker; - if(!message->readByte(marker)) - return; - assert_and_throw(marker==0x11); - _R<ASObject> ret=_MR(ByteArray::readObject(message.getPtr(), NULL, 0)); - - if(!responder.isNull()) + for(uint32_t i=0;i<numMessage;i++) { - multiname onResultName(NULL); - onResultName.name_type=multiname::NAME_STRING; - onResultName.name_s_id=m_sys->getUniqueStringId("onResult"); - onResultName.ns.emplace_back(m_sys,BUILTIN_STRINGS::EMPTY,NAMESPACE); - _NR<ASObject> callback = responder->getVariableByMultiname(onResultName); - if(!callback.isNull() && callback->getObjectType() == T_FUNCTION) + + tiny_string target; + if(!message->readUTF(target)) + return; + tiny_string response; + if(!message->readUTF(response)) + return; + + //TODO: Really use the response to map request/responses and detect errors + uint32_t objLen; + if(!message->readUnsignedInt(objLen)) + return; + uint8_t marker; + if(!message->peekByte(marker)) + return; + if (marker == 0x11 && message->getCurrentObjectEncoding() != ObjectEncoding::AMF3) // switch to AMF3 { - ret->incRef(); - ASObject* const callbackArgs[1] {ret.getPtr()}; - responder->incRef(); - callback->as<IFunction>()->call(responder.getPtr(), callbackArgs, 1); + message->setCurrentObjectEncoding(ObjectEncoding::AMF3); + message->readByte(marker); + } + _R<ASObject> ret=_MR(ByteArray::readObject(message.getPtr(), NULL, 0)); + + if(!responder.isNull()) + { + multiname onResultName(NULL); + onResultName.name_type=multiname::NAME_STRING; + onResultName.name_s_id=m_sys->getUniqueStringId("onResult"); + onResultName.ns.emplace_back(m_sys,BUILTIN_STRINGS::EMPTY,NAMESPACE); + _NR<ASObject> callback = responder->getVariableByMultiname(onResultName); + if(!callback.isNull() && callback->getObjectType() == T_FUNCTION) + { + ret->incRef(); + ASObject* const callbackArgs[1] {ret.getPtr()}; + responder->incRef(); + callback->as<IFunction>()->call(responder.getPtr(), callbackArgs, 1); + } } } } @@ -2015,7 +2025,7 @@ case 0x08: //Namespace { assert_and_throw(constant_pool.namespaces[index].name); - Namespace* ret = Class<Namespace>::getInstanceS(root->getSystemState(),getString(constant_pool.namespaces[index].name)); + Namespace* ret = Class<Namespace>::getInstanceS(root->getSystemState(),getString(constant_pool.namespaces[index].name),BUILTIN_STRINGS::EMPTY,(NS_KIND)(int)constant_pool.namespaces[index].kind); if (constant_pool.namespaces[index].kind != 0) ret->nskind =(NS_KIND)(int)(constant_pool.namespaces[index].kind); return ret;
View file
lightspark.tar.xz/src/scripting/abc_opcodes.cpp
Changed
@@ -2776,9 +2776,8 @@ Namespace* ABCVm::pushNamespace(call_context* th, int n) { const namespace_info& ns_info=th->context->constant_pool.namespaces[n]; - assert(ns_info.kind == NAMESPACE); LOG_CALL( _("pushNamespace ") << th->context->root->getSystemState()->getStringFromUniqueId(th->context->getString(ns_info.name)) ); - return Class<Namespace>::getInstanceS(th->context->root->getSystemState(),th->context->getString(ns_info.name)); + return Class<Namespace>::getInstanceS(th->context->root->getSystemState(),th->context->getString(ns_info.name),BUILTIN_STRINGS::EMPTY,(NS_KIND)(int)ns_info.kind); } /* @spec-checked avm2overview */
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -1395,6 +1395,9 @@ { MovieClip* th=static_cast<MovieClip*>(obj); //currentFrame is 1-based and relative to current scene + if (th->state.explicit_FP) + // if frame is set explicitly, the currentframe property should be set to next_FP, even if it is not displayed yet + return abstract_i(obj->getSystemState(),th->state.next_FP+1 - th->scenes[th->getCurrentScene()].startframe); return abstract_i(obj->getSystemState(),th->state.FP+1 - th->scenes[th->getCurrentScene()].startframe); }
View file
lightspark.tar.xz/src/scripting/flash/system/flashsystem.cpp
Changed
@@ -310,7 +310,7 @@ throwError<ReferenceError>(kClassNotFoundError,name.normalizedNameUnresolved(obj->getSystemState())); //TODO: specs says that also namespaces and function may be returned - assert_and_throw(o->getObjectType()==T_CLASS); + //assert_and_throw(o->getObjectType()==T_CLASS); LOG(LOG_CALLS,_("Getting definition for ") << name); o->incRef();
View file
lightspark.tar.xz/src/scripting/toplevel/Array.h
Changed
@@ -93,8 +93,8 @@ void constructorImpl(ASObject* const* args, const unsigned int argslen); tiny_string toString_priv(bool localized=false) const; int capIndex(int i) const; - static bool isIntegerWithoutLeadingZeros(const tiny_string& value); public: + static bool isIntegerWithoutLeadingZeros(const tiny_string& value); enum SORTTYPE { CASEINSENSITIVE=1, DESCENDING=2, UNIQUESORT=4, RETURNINDEXEDARRAY=8, NUMERIC=16 }; Array(Class_base* c); bool destruct()
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -1707,7 +1707,7 @@ uint32_t ns_prefix = BUILTIN_STRINGS::EMPTY; if(name.ns.size() > 0 && !name.ns[0].hasEmptyName()) { - assert_and_throw(name.ns[0].kind==NAMESPACE); + //assert_and_throw(name.ns[0].kind==NAMESPACE); ns_uri=name.ns[0].nsNameId; ns_prefix=getNamespacePrefixByURI(ns_uri); }
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -1710,8 +1710,8 @@ { } -Namespace::Namespace(Class_base* c, uint32_t _uri, uint32_t _prefix) - : ASObject(c,T_NAMESPACE),nskind(NAMESPACE),prefix_is_undefined(false),uri(_uri),prefix(_prefix) +Namespace::Namespace(Class_base* c, uint32_t _uri, uint32_t _prefix, NS_KIND _nskind) + : ASObject(c,T_NAMESPACE),nskind(_nskind),prefix_is_undefined(false),uri(_uri),prefix(_prefix) { }
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.h
Changed
@@ -716,7 +716,7 @@ uint32_t prefix; public: Namespace(Class_base* c); - Namespace(Class_base* c, uint32_t _uri, uint32_t _prefix=BUILTIN_STRINGS::EMPTY); + Namespace(Class_base* c, uint32_t _uri, uint32_t _prefix=BUILTIN_STRINGS::EMPTY,NS_KIND _nskind = NAMESPACE); static void sinit(Class_base*); static void buildTraits(ASObject* o); ASFUNCTION(_constructor);
View file
lightspark.tar.xz/src/swf.cpp
Changed
@@ -2046,7 +2046,7 @@ return; tiny_string clsname; - if (!classname.nsStringId != BUILTIN_STRINGS::EMPTY) + if (classname.nsStringId != BUILTIN_STRINGS::EMPTY) clsname = getSystemState()->getStringFromUniqueId(classname.nsStringId) + "."; clsname += getSystemState()->getStringFromUniqueId(classname.nameId);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.