Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > ecbfffd53099d296aa3be64531b34419 > files > 22

mplayer-1.0-1.rc1.20.6mdv2008.0.src.rpm

--- stream/realrtsp/asmrp.c.debian	2006-10-23 00:32:25.000000000 +0200
+++ stream/realrtsp/asmrp.c	2007-02-22 13:40:06.000000000 +0100
@@ -40,6 +40,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include "asmrp.h"
 
 /*
 #define LOG
@@ -645,8 +646,10 @@
 #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++;
--- stream/realrtsp/asmrp.h.debian	2006-10-23 00:32:25.000000000 +0200
+++ stream/realrtsp/asmrp.h	2007-02-22 13:40:06.000000000 +0100
@@ -40,6 +40,8 @@
 #ifndef HAVE_ASMRP_H
 #define HAVE_ASMRP_H
 
+#define MAX_RULEMATCHES 16
+
 int asmrp_match (const char *rules, int bandwidth, int *matches) ;
 
 #endif
--- stream/realrtsp/real.c.debian	2006-10-23 00:32:25.000000000 +0200
+++ stream/realrtsp/real.c	2007-02-22 13:40:06.000000000 +0100
@@ -271,7 +271,7 @@
     int j=0;
     int n;
     char b[64];
-    int rulematches[16];
+    int rulematches[MAX_RULEMATCHES];
 
 #ifdef LOG
     printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth);