From da7b1d29c60f740037883f44e07415580fc5d9a9 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Fri, 29 Jan 2016 09:05:44 -0700 Subject: libhb: fix use of uninitialized variable in lang.c It caused crashes in some builds --- libhb/lang.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libhb/lang.c') diff --git a/libhb/lang.c b/libhb/lang.c index a8ed2e8c8..c51c80ad5 100644 --- a/libhb/lang.c +++ b/libhb/lang.c @@ -205,7 +205,7 @@ static const int lang_count = sizeof(languages) / sizeof(languages[0]); const int lang_lookup_index( const char * str ) { int ii = 0; - iso639_lang_t * lang; + const iso639_lang_t * lang; // We use "Any" as a synonym for undefined if (!strcasecmp("any", str)) @@ -213,7 +213,7 @@ const int lang_lookup_index( const char * str ) return 0; } - for (ii = 0; lang->eng_name; ii++) + for (ii = 0; languages[ii].eng_name; ii++) { lang = &languages[ii]; if ((lang->iso639_1 != NULL && !strcasecmp(lang->iso639_1, str)) || @@ -234,7 +234,7 @@ const iso639_lang_t * lang_lookup( const char * str ) return lang_for_index(lang_lookup_index(str)); } -iso639_lang_t * lang_for_index( int index ) +const iso639_lang_t * lang_for_index( int index ) { if (index < 0 || index >= lang_count) return NULL; -- cgit v1.2.3