--- MPlayer-1.0pre8/libmpdemux/realrtsp/asmrp.c +++ MPlayer-1.0pre8/libmpdemux/realrtsp/asmrp.c @@ -628,7 +628,7 @@ static int asmrp_rule (asmrp_t *p) { return ret; } -static int asmrp_eval (asmrp_t *p, int *matches) { +static int asmrp_eval (asmrp_t *p, int *matches, int matchsize) { int rule_num, num_matches; @@ -639,7 +639,7 @@ static int asmrp_eval (asmrp_t *p, int *matches) { asmrp_get_sym (p); rule_num = 0; num_matches = 0; - while (p->sym != ASMRP_SYM_EOF) { + while (p->sym != ASMRP_SYM_EOF && num_matches < matchsize - 1) { if (asmrp_rule (p)) { #ifdef LOG @@ -656,7 +656,7 @@ static int asmrp_eval (asmrp_t *p, int *matches) { return num_matches; } -int asmrp_match (const char *rules, int bandwidth, int *matches) { +int asmrp_match (const char *rules, int bandwidth, int *matches, int matchsize) { asmrp_t *p; int num_matches; @@ -668,7 +668,7 @@ int asmrp_match (const char *rules, int bandwidth, int *matches) { asmrp_set_id (p, "Bandwidth", bandwidth); asmrp_set_id (p, "OldPNMPlayer", 0); - num_matches = asmrp_eval (p, matches); + num_matches = asmrp_eval (p, matches, matchsize); asmrp_dispose (p); --- MPlayer-1.0pre8/libmpdemux/realrtsp/asmrp.h +++ MPlayer-1.0pre8/libmpdemux/realrtsp/asmrp.h @@ -40,6 +40,6 @@ #ifndef HAVE_ASMRP_H #define HAVE_ASMRP_H -int asmrp_match (const char *rules, int bandwidth, int *matches) ; +int asmrp_match (const char *rules, int bandwidth, int *matches, int matchesizxe) ; #endif --- MPlayer-1.0pre8/libmpdemux/realrtsp/real.c +++ MPlayer-1.0pre8/libmpdemux/realrtsp/real.c @@ -533,7 +533,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt #ifdef LOG printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); #endif - n=asmrp_match(desc->stream[i]->asm_rule_book, bandwidth, rulematches); + n=asmrp_match(desc->stream[i]->asm_rule_book, bandwidth, rulematches, sizeof(rulematches)/sizeof(rulematches[0])); for (j=0; j<n; j++) { #ifdef LOG printf("asmrp rule match: %u for stream %u\n", rulematches[j], desc->stream[i]->stream_id);