From 1a24034f3d5e4b036e40677d98e9d9c88ea66d41 Mon Sep 17 00:00:00 2001 From: hyc Date: Sat, 9 Jan 2010 02:31:17 +0000 Subject: [PATCH] Fix AMF_Decode() end detection git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@220 400ebc74-4327-4243-bc38-086b20814532 --- amf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amf.c b/amf.c index ae7aaf2..cfd52d1 100644 --- a/amf.c +++ b/amf.c @@ -1038,12 +1038,12 @@ AMF_Decode(AMFObject * obj, const char *pBuffer, int nSize, bool bDecodeName) obj->o_num = 0; obj->o_props = NULL; - while (nSize >= 3) + while (nSize > 0) { AMFObjectProperty prop; int nRes; - if (AMF_DecodeInt24(pBuffer) == AMF_OBJECT_END) + if (nSize >=3 && AMF_DecodeInt24(pBuffer) == AMF_OBJECT_END) { nSize -= 3; bError = false; -- 2.50.1