[FFmpeg-cvslog] r20575 - trunk/libavformat/rtmppkt.c

kostya subversion
Sun Nov 22 10:03:06 CET 2009


Author: kostya
Date: Sun Nov 22 10:03:06 2009
New Revision: 20575

Log:
When searching for AMF object field value, try to find that object first
instead of assuming it should occur right at given position.
This helps finding human-readable error descriptions in RTMP server replies.

Modified:
   trunk/libavformat/rtmppkt.c

Modified: trunk/libavformat/rtmppkt.c
==============================================================================
--- trunk/libavformat/rtmppkt.c	Sun Nov 22 09:42:55 2009	(r20574)
+++ trunk/libavformat/rtmppkt.c	Sun Nov 22 10:03:06 2009	(r20575)
@@ -233,10 +233,15 @@ int ff_amf_get_field_value(const uint8_t
     int namelen = strlen(name);
     int len;
 
+    while (*data != AMF_DATA_TYPE_OBJECT && data < data_end) {
+        len = ff_amf_tag_size(data, data_end);
+        if (len < 0)
+            len = data_end - data;
+        data += len;
+    }
     if (data_end - data < 3)
         return -1;
-    if (*data++ != AMF_DATA_TYPE_OBJECT)
-        return -1;
+    data++;
     for (;;) {
         int size = bytestream_get_be16(&data);
         if (!size)



More information about the ffmpeg-cvslog mailing list