Commit b0e2e3b8 authored by Pavlov Konstantin's avatar Pavlov Konstantin

Some more fixes from upstream xine:

* Fix program termination due to invalid Real Media SDP; reported by Roland
Kay. [bug #1602663]

CVS patchset: 8441
CVS date: 2006/12/25 16:12:16
parent d93b7a36
...@@ -91,7 +91,7 @@ static char *nl(char *data) { ...@@ -91,7 +91,7 @@ static char *nl(char *data) {
static int filter(const char *in, const char *filter, char **out) { static int filter(const char *in, const char *filter, char **out) {
int flen=strlen(filter); int flen=strlen(filter);
int len; size_t len;
if (!in) return 0; if (!in) return 0;
...@@ -179,11 +179,13 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { ...@@ -179,11 +179,13 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
} }
if(filter(*data,"a=OpaqueData:buffer;",&buf)) { if(filter(*data,"a=OpaqueData:buffer;",&buf)) {
decoded = b64_decode(buf, decoded, &(desc->mlti_data_size)); decoded = b64_decode(buf, decoded, &(desc->mlti_data_size));
desc->mlti_data = malloc(sizeof(char)*desc->mlti_data_size); if ( decoded != NULL ) {
memcpy(desc->mlti_data, decoded, desc->mlti_data_size); desc->mlti_data = malloc(sizeof(char)*desc->mlti_data_size);
handled=1; memcpy(desc->mlti_data, decoded, desc->mlti_data_size);
*data=nl(*data); handled=1;
lprintf("mlti_data_size: %i\n", desc->mlti_data_size); *data=nl(*data);
lprintf("mlti_data_size: %i\n", desc->mlti_data_size);
}
} }
if(filter(*data,"a=ASMRuleBook:string;",&buf)) { if(filter(*data,"a=ASMRuleBook:string;",&buf)) {
desc->asm_rule_book=strdup(buf); desc->asm_rule_book=strdup(buf);
...@@ -244,27 +246,35 @@ sdpplin_t *sdpplin_parse(char *data) { ...@@ -244,27 +246,35 @@ sdpplin_t *sdpplin_parse(char *data) {
} }
if(filter(data,"a=Title:buffer;",&buf)) { if(filter(data,"a=Title:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len); decoded=b64_decode(buf, decoded, &len);
desc->title=strdup(decoded); if ( decoded != NULL ) {
handled=1; desc->title=strdup(decoded);
data=nl(data); handled=1;
data=nl(data);
}
} }
if(filter(data,"a=Author:buffer;",&buf)) { if(filter(data,"a=Author:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len); decoded=b64_decode(buf, decoded, &len);
desc->author=strdup(decoded); if ( decoded != NULL ) {
handled=1; desc->author=strdup(decoded);
data=nl(data); handled=1;
data=nl(data);
}
} }
if(filter(data,"a=Copyright:buffer;",&buf)) { if(filter(data,"a=Copyright:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len); decoded=b64_decode(buf, decoded, &len);
desc->copyright=strdup(decoded); if ( decoded != NULL ) {
handled=1; desc->copyright=strdup(decoded);
data=nl(data); handled=1;
data=nl(data);
}
} }
if(filter(data,"a=Abstract:buffer;",&buf)) { if(filter(data,"a=Abstract:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len); decoded=b64_decode(buf, decoded, &len);
desc->abstract=strdup(decoded); if ( decoded != NULL ) {
handled=1; desc->abstract=strdup(decoded);
data=nl(data); handled=1;
data=nl(data);
}
} }
if(filter(data,"a=StreamCount:integer;",&buf)) { if(filter(data,"a=StreamCount:integer;",&buf)) {
desc->stream_count=atoi(buf); desc->stream_count=atoi(buf);
......
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