summaryrefslogtreecommitdiffstats
path: root/libhb/preset.c
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2018-01-12 20:54:08 +0100
committerDamiano Galassi <[email protected]>2018-01-12 20:55:14 +0100
commit696ebe518b38bb186e7f6692f91a3c799f3c838c (patch)
treeecc88a4c55f1a5c0414f57fb175149b1fe8c9d3b /libhb/preset.c
parent9bd2b8e50ca2e8e0b52580714b54dbca33b809a5 (diff)
libhb: fix a number of issues reported by clang.
Diffstat (limited to 'libhb/preset.c')
-rw-r--r--libhb/preset.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libhb/preset.c b/libhb/preset.c
index 5840714ce..710499024 100644
--- a/libhb/preset.c
+++ b/libhb/preset.c
@@ -921,7 +921,6 @@ static void add_subtitle_for_lang(hb_value_array_t *list, hb_title_t *title,
subtitle_behavior_t *behavior)
{
int t;
- t = find_subtitle_track(title, lang, 0);
for (t = find_subtitle_track(title, lang, 0);
t >= 0;
t = behavior->one ? -1 : find_subtitle_track(title, lang, t + 1))
@@ -3698,6 +3697,12 @@ int hb_presets_add_path(char * path)
{
count++;
}
+
+ if (count == 0)
+ {
+ return -1;
+ }
+
files = malloc(count * sizeof(char*));
// Find all regular files