Commit 7bf999c0 authored by kostya's avatar kostya

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. 



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20575 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 639a0b1a
...@@ -233,10 +233,15 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end, ...@@ -233,10 +233,15 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
int namelen = strlen(name); int namelen = strlen(name);
int len; 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) if (data_end - data < 3)
return -1; return -1;
if (*data++ != AMF_DATA_TYPE_OBJECT) data++;
return -1;
for (;;) { for (;;) {
int size = bytestream_get_be16(&data); int size = bytestream_get_be16(&data);
if (!size) if (!size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment