]> www.vanbest.org Git - sasc-ng.git/commitdiff
sasc: fix memory trashing in ffdecsa plugin
authorleslie <unknown>
Sat, 7 Nov 2009 08:49:02 +0000 (16:49 +0800)
committerleslie <unknown>
Sat, 7 Nov 2009 08:49:02 +0000 (16:49 +0800)
contrib/sasc-ng/dvblb_plugins/plugin_ffdecsa.c

index e3b2ae16a7e9c2420d5ac4494c1fb71ea9c6d51a..030be27dc650532ecc5bb367b18c6dc8c4efb42a 100644 (file)
@@ -15,7 +15,7 @@
 #define DBG_NAME "CSA"
 #include "debug.h" //This is required to happen AFTER PLUGIN_ID is defined
 
-#define FF_MAX_IDX 8
+#define FF_MAX_IDX 16
 #define FF_MAX_PID 8
 
 #define push_empty_queue(_item, _queue) {      \
@@ -95,6 +95,8 @@ void update_keys(int adpt, unsigned char keytype, int index, unsigned char *key,
     assert(csa);
     if(! csa)
       return;
+    if(index < 0 || index >= FF_MAX_IDX)
+      return;
 
     pthread_mutex_lock(&csa->state_lock);
     if (keytype == 'I') //Invalidate