]> granicus.if.org Git - rtmpdump/commitdiff
Fix AMF_Decode() end detection
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 9 Jan 2010 02:31:17 +0000 (02:31 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 9 Jan 2010 02:31:17 +0000 (02:31 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@220 400ebc74-4327-4243-bc38-086b20814532

amf.c

diff --git a/amf.c b/amf.c
index ae7aaf2f25893447166620a7711928f1b60fdf46..cfd52d1b9554f52d704e356760ae6b27a7e54b4f 100644 (file)
--- 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;