]> granicus.if.org Git - handbrake/commitdiff
LinGui: fix a filter validation issue
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 5 Oct 2015 18:38:33 +0000 (11:38 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 5 Oct 2015 18:38:33 +0000 (11:38 -0700)
... and a crash when adding to the queue.

gtk/src/hb-backend.c
gtk/src/queuehandler.c

index 346b60e2496157f93c48c30c99c87bce21051c62..57135578bb6fec9ed8a9dd90bca6448c87fa7bbc 100644 (file)
@@ -3911,6 +3911,10 @@ ghb_lookup_filter_name(int filter_id, const char *short_name, int preset)
     {
         map = hb_filter_param_get_tunes(filter_id);
     }
+    if (map == NULL)
+    {
+        return NULL;
+    }
     for (ii = 0; map[ii].name != NULL; ii++)
     {
         if (!strcasecmp(map[ii].short_name, short_name))
@@ -4009,7 +4013,8 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
         filter_id = HB_FILTER_DETELECINE;
         if (!strcasecmp(detel_preset, "custom"))
         {
-            detel_custom = ghb_dict_get_string(settings, "PictureDecombCustom");
+            detel_custom = ghb_dict_get_string(settings,
+                                               "PictureDetelecineCustom");
         }
         if (hb_validate_filter_preset(filter_id, detel_preset, detel_custom))
         {
@@ -4038,7 +4043,8 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
     denoise_filter = ghb_dict_get_string(settings, "PictureDenoiseFilter");
     if (strcasecmp(denoise_filter, "off"))
     {
-        const char *denoise_preset, *denoise_tune, *denoise_custom = NULL;
+        const char *denoise_preset;
+        const char *denoise_tune = NULL, *denoise_custom = NULL;
         int filter_id;
 
         if (!strcasecmp(denoise_filter, "nlmeans"))
@@ -4059,7 +4065,10 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
             return FALSE;
         }
         denoise_preset = ghb_dict_get_string(settings, "PictureDenoisePreset");
-        denoise_tune   = ghb_dict_get_string(settings, "PictureDenoiseTune");
+        if (filter_id == HB_FILTER_NLMEANS)
+        {
+            denoise_tune = ghb_dict_get_string(settings, "PictureDenoiseTune");
+        }
         if (!strcasecmp(denoise_preset, "custom"))
         {
             denoise_custom = ghb_dict_get_string(settings,
index 4780dde9a7b032179d97a9806fac5144b162bc6a..1aabc5298b672050173ad39930993a1d70f4a2b7 100644 (file)
@@ -394,7 +394,7 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter
                 XPRINT(" %s", denoise_preset);
                 const char *tune;
                 tune = ghb_dict_get_string(settings, "PictureDenoiseTune");
-                if (denoise == HB_FILTER_NLMEANS &&
+                if (denoise == HB_FILTER_NLMEANS && denoise_tune != NULL &&
                     tune != NULL && strcasecmp(tune, "none"))
                 {
                     XPRINT(",%s", denoise_tune);