summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-06-13 10:11:30 -0700
committerJohn Stebbins <[email protected]>2018-06-13 10:11:30 -0700
commitc85294a8f0bce69d5cb417f60a143663fb83772a (patch)
treee6f68e663722653d93b7069c8fc75a0425fd8d2c /gtk
parent256c9acab3e49d61bb3a48c8fe60c7b17c09bad6 (diff)
libhb: fix snprintf compiler warnings
Our handling of temporary directory paths could truncate resulting filenames. This fixes the warnings and prevents possible truncation.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/hb-backend.c12
-rw-r--r--gtk/src/preview.c1
2 files changed, 5 insertions, 8 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 8a9ed99b0..3143eb8c4 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1093,24 +1093,20 @@ hb_handle_t* ghb_live_handle(void)
return h_live;
}
-extern void hb_get_temporary_directory(char path[512]);
-
gchar*
ghb_get_tmp_dir()
{
- char dir[512];
-
- hb_get_temporary_directory(dir);
- return g_strdup(dir);
+ return hb_get_temporary_directory();
}
void
ghb_hb_cleanup(gboolean partial)
{
- char dir[512];
+ char * dir;
- hb_get_temporary_directory(dir);
+ dir = hb_get_temporary_directory();
del_tree(dir, !partial);
+ free(dir);
}
gint
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 3a28aa4bd..4537f9644 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -650,6 +650,7 @@ live_preview_start_cb(GtkWidget *xwidget, signal_user_data_t *ud)
tmp_dir = ghb_get_tmp_dir();
name = g_strdup_printf("%s/live%02d", tmp_dir, ud->preview->frame);
+ free(tmp_dir);
if (ud->preview->current)
g_free(ud->preview->current);
ud->preview->current = name;