[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. f5d7bf8e002c3299c7cb
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e |
Date: |
Thu, 09 Dec 2010 13:02:59 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".
The branch, master has been updated
via f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e (commit)
from 52d733fdec7414a5549bc2b9622d2cc48b750651 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e
commit f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e
Author: Benjamin Wolsey <address@hidden>
Date: Thu Dec 9 13:46:23 2010 +0100
Use exising AMF functions to clean up.
diff --git a/libcore/asobj/NetStream_as.cpp b/libcore/asobj/NetStream_as.cpp
index b5159c6..786325f 100644
--- a/libcore/asobj/NetStream_as.cpp
+++ b/libcore/asobj/NetStream_as.cpp
@@ -43,8 +43,8 @@
#include "MediaHandler.h"
#include "StreamProvider.h"
#include "sound_handler.h"
-#include "GnashSystemNetHeaders.h"
#include "AMFConverter.h"
+#include "AMF.h"
// Define the following macro to have status notification handling debugged
//#define GNASH_DEBUG_STATUS
@@ -1870,26 +1870,18 @@ attachNetStreamInterface(as_object& o)
void
executeTag(const SimpleBuffer& _buffer, as_object& thisPtr)
{
-
const boost::uint8_t* ptr = _buffer.data();
const boost::uint8_t* endptr = ptr + _buffer.size();
- if (endptr - ptr < 2) {
- log_error("Premature end of AMF in NetStream metatag");
- return;
- }
- const boost::uint16_t length = ntohs((*(boost::uint16_t *)ptr) &
0xffff);
- ptr += 2;
-
- if (endptr - ptr < length) {
- log_error("Premature end of AMF in NetStream metatag");
- return;
- }
-
- const std::string funcName(reinterpret_cast<const char*>(ptr), length);
- ptr += length;
+ std::string funcName;
- log_debug("funcName: %s", funcName);
+ try {
+ funcName = amf::readString(ptr, endptr);
+ }
+ catch (const amf::AMFException&) {
+ log_error("Invalid AMF data in FLV tag");
+ return;
+ }
VM& vm = getVM(thisPtr);
const ObjectURI& funcKey = getURI(vm, funcName);
@@ -1898,8 +1890,8 @@ executeTag(const SimpleBuffer& _buffer, as_object&
thisPtr)
as_value arg;
if (!rd(arg)) {
- log_error("Could not convert FLV metatag to as_value, but will
try "
- "passing it anyway. It's an %s", arg);
+ log_error("Could not convert FLV metatag to as_value, passing "
+ "undefined");
}
log_debug("Calling %s(%s)", funcName, arg);
-----------------------------------------------------------------------
Summary of changes:
libcore/asobj/NetStream_as.cpp | 30 +++++++++++-------------------
1 files changed, 11 insertions(+), 19 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e,
Benjamin Wolsey <=