$OpenBSD: patch-libmpdemux_realrtsp_asmrp_c,v 1.4 2007/04/19 08:37:09 ajacoutot Exp $
--- libmpdemux/realrtsp/asmrp.c.orig	Sun Jun 11 20:35:46 2006
+++ libmpdemux/realrtsp/asmrp.c	Thu Apr 19 09:41:03 2007
@@ -40,6 +40,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include "asmrp.h"
 
 /*
 #define LOG
@@ -645,8 +646,10 @@ static int asmrp_eval (asmrp_t *p, int *matches) {
 #ifdef LOG
       printf ("rule #%d is true\n", rule_num);
 #endif
-      matches[num_matches] = rule_num;
-      num_matches++;
+      if(num_matches < MAX_RULEMATCHES - 1)
+        matches[num_matches++] = rule_num;
+      else
+        printf("Ignoring matched asm rule %d, too many matched rules.\n", rule_num);
     }
 
     rule_num++;
