]> granicus.if.org Git - handbrake/commitdiff
LinGui: fix crash if all titles are too short
authorjstebbins <jstebbins.hb@gmail.com>
Mon, 24 Feb 2014 22:16:30 +0000 (22:16 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Mon, 24 Feb 2014 22:16:30 +0000 (22:16 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6080 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c

index 08c273251ed63b0752af58a7dcff36654d711569..81522d5ada63b1dbc50466a97c327879f0f74d06 100644 (file)
@@ -3008,14 +3008,17 @@ ghb_backend_events(signal_user_data_t *ud)
 
         label = GTK_LABEL(GHB_WIDGET (ud->builder, "volume_label"));
 
+        ghb_clear_scan_state(GHB_STATE_SCANDONE);
         // Are there really any titles.
         if (title == NULL)
         {
             gtk_label_set_text(label, _("No Title Found"));
+            ghb_ui_update(ud, "title", ghb_int64_value(-1));
+        }
+        else
+        {
+            ghb_ui_update(ud, "title", ghb_int64_value(title->index));
         }
-        ghb_clear_scan_state(GHB_STATE_SCANDONE);
-
-        ghb_ui_update(ud, "title", ghb_int64_value(title->index));
 
         if (ghb_queue_edit_settings != NULL)
         {