aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-11-22 09:03:06 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-11-22 09:03:06 +0000
commit87ca1b8f7faee37905fec1e165adab45f80d490f (patch)
tree497df9333204148a680a48615821442265d343e5
parentfe52395878d4f0010829e0acfed34f3fe1972efe (diff)
downloadffmpeg-87ca1b8f7faee37905fec1e165adab45f80d490f.tar.gz
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. Originally committed as revision 20575 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rtmppkt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index e1f0647fbb..063a887282 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -233,10 +233,15 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
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)