diff --git a/README.md b/README.md index 9e9cc3490..81483f655 100755 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v1.0, 2014-10-24, fix [#186](https://github.com/winlinvip/simple-rtmp-server/issues/186), hotfix for bug #186, drop connect args when not object. 1.0.3. * v1.0, 2014-10-24, rename wiki/xxx to wiki/v1_xxx. 1.0.2. * v1.0, 2014-10-19, fix [#183](https://github.com/winlinvip/simple-rtmp-server/issues/183), hotfix for bug #183, donot support AnnexB when decoding RTMP body for HLS. 1.0.1. * v1.0, 2014-10-09, [1.0 beta(1.0.0)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.beta) released. 59316 lines. diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 44f8e2ebc..2715e5d0c 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "1" #define VERSION_MINOR "0" -#define VERSION_REVISION "2" +#define VERSION_REVISION "3" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/rtmp/srs_protocol_stack.cpp b/trunk/src/rtmp/srs_protocol_stack.cpp index 66d3798f7..ce7222b6c 100644 --- a/trunk/src/rtmp/srs_protocol_stack.cpp +++ b/trunk/src/rtmp/srs_protocol_stack.cpp @@ -1864,11 +1864,23 @@ int SrsConnectAppPacket::decode(SrsStream* stream) if (!stream->empty()) { srs_freep(args); - args = SrsAmf0Any::object(); - if ((ret = args->read(stream)) != ERROR_SUCCESS) { + + // see: https://github.com/winlinvip/simple-rtmp-server/issues/186 + // the args maybe any amf0, for instance, a string. we should drop if not object. + SrsAmf0Any* any = NULL; + if ((ret = SrsAmf0Any::discovery(stream, &any)) != ERROR_SUCCESS) { srs_error("amf0 decode connect args failed. ret=%d", ret); return ret; } + srs_assert(any); + + // drop when not an AMF0 object. + if (!any->is_object()) { + srs_warn("drop the args, see: '4.1.1. connect', marker=%#x", any->marker); + srs_freep(any); + } else { + args = any->to_object(); + } } srs_info("amf0 decode connect packet success");