summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-07-28 04:55:52 +0000
committerjstebbins <[email protected]>2008-07-28 04:55:52 +0000
commitcd18a6fff47eb748cde2df8c3b719e3a07b71543 (patch)
tree82314312da8aae78493cfb173adf73ad6ead6e33 /gtk
parentb5185c17599137dff179e9dadc420686592c291d (diff)
LinGui: fix segfault when "." in destination is deleted.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1585 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 03af56480..b5646d3c6 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -684,7 +684,7 @@ dvd_source_activate_cb(GtkAction *action, signal_user_data_t *ud)
static void
update_destination_extension(signal_user_data_t *ud)
{
- static gchar *containers[] = {"mkv", "mp4", "m4v", "avi", "ogm", NULL};
+ static gchar *containers[] = {".mkv", ".mp4", ".m4v", ".avi", ".ogm", NULL};
gchar *filename;
const gchar *extension;
gint ii;
@@ -702,6 +702,11 @@ update_destination_extension(signal_user_data_t *ud)
gchar *new_name;
pos = g_strrstr( filename, "." );
+ if (pos == NULL)
+ {
+ // No period? shouldn't happen
+ break;
+ }
*pos = 0;
if (strcmp(extension, &pos[1]) == 0)
{