diff --git a/aegisub/mythes.cxx b/aegisub/mythes.cxx index 44de96b38..39c56dab9 100644 --- a/aegisub/mythes.cxx +++ b/aegisub/mythes.cxx @@ -371,6 +371,7 @@ int MyThes::binsearch(char * sw, char* list[], int nlst) lp = 0; up = nlst-1; indx = -1; + if (nlst == 0) return -1; if (strcmp(sw,list[lp]) < 0) return -1; if (strcmp(sw,list[up]) > 0) return -1; while (indx < 0 ) { @@ -394,3 +395,4 @@ char * MyThes::get_th_encoding() return NULL; } +