On 01/14/2011 04:19 PM, IOhannes zmölnig wrote:
> On 01/14/2011 04:12 PM, IOhannes zmölnig wrote:
>> i discovered one as well:
>> if there are no (valid) plugins installed, pluginregistry will crash.
> 
> unfortunately that is not the only problem i have:
> 
> i'm trying to understand a related bug crashing gmerlin_visualize when
> saving properties in parameter_xml.c:385
> 

here is a revised patch, that at least let me run the 4 apps that
provide -help-man (gmerlin_imgconvert gmerlin_launcher
gmerlin-video-thumbnailer gmerlin_visualize)

however, these apps still crash, if no plugins are present:
/usr/bin/camelot
/usr/bin/gmerlin
/usr/bin/gmerlin_plugincfg
/usr/bin/gmerlin_recorder
/usr/bin/gmerlin_transcoder
/usr/bin/gmerlin_visualizer

i currently don't have time nor the full overview of the code to
properly fix the underlying problem.

fgmasdr
IOhannes
Author: IOhannes m zmölnig
Description: prevent segfaults if no plugins can be found
--- gmerlin.orig/lib/pluginregistry.c
+++ gmerlin/lib/pluginregistry.c
@@ -174,6 +174,9 @@
   bg_plugin_info_t ** arr;
   int num_plugins = 0;
   int keep_going;
+
+  if(NULL==list)
+    return NULL;
   
   /* Count plugins */
 
@@ -216,7 +219,8 @@
 
   for(i = 0; i < num_plugins-1; i++)
     arr[i]->next = arr[i+1];
-  arr[num_plugins-1]->next = (bg_plugin_info_t*)0;
+  if(num_plugins>0)
+    arr[num_plugins-1]->next = (bg_plugin_info_t*)0;
   list = arr[0];
   /* Free array */
   free(arr);
@@ -957,16 +961,18 @@
   if(ret->singlepic_encoder)
     ret->entries = append_to_list(ret->entries, ret->singlepic_encoder);
   
-  /* Sort */
-
-  ret->entries = sort_by_priority(ret->entries);
+  if(ret->entries)
+    {
+    /* Sort */
+    ret->entries = sort_by_priority(ret->entries);
 
-  if(!opt->dont_save)
-    bg_plugin_registry_save(ret->entries);
-  
-  /* Remove duplicate external plugins */
-  ret->entries = remove_duplicate(ret->entries);
+    if(!opt->dont_save)
+      bg_plugin_registry_save(ret->entries);
   
+    /* Remove duplicate external plugins */
+    ret->entries = remove_duplicate(ret->entries);
+    }
+
   /* Kick out unsupported plugins */
   tmp_info = ret->entries;
 

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to