diff --git a/ChangeLog b/ChangeLog index d0b97eba3..6a65058d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-08 Moritz Bunkus + + * mkvinfo: bug fix: The chapter and tag element tables were not + initialized on Windows resulting in a crash when one of those + elements was encountered. + 2004-10-07 Moritz Bunkus * Released v0.9.6. diff --git a/src/mkvinfo.cpp b/src/mkvinfo.cpp index d3150c533..1d052414e 100644 --- a/src/mkvinfo.cpp +++ b/src/mkvinfo.cpp @@ -1894,26 +1894,6 @@ process_file(const char *file_name) { } } -int -console_main(int argc, - char **argv) { - char *file_name; - -#if defined(SYS_UNIX) || defined(COMP_CYGWIN) - nice(2); -#endif - - parse_args(argc, argv, file_name); - if (file_name == NULL) { - usage(); - mxexit(0); - } - if (process_file(file_name)) - return 0; - else - return 1; -} - void setup() { #if defined(HAVE_LIBINTL_H) @@ -1934,20 +1914,36 @@ cleanup() { utf8_done(); } +int +console_main(int argc, + char **argv) { + char *file_name; + bool ok; + +#if defined(SYS_UNIX) || defined(COMP_CYGWIN) + nice(2); +#endif + + setup(); + parse_args(argc, argv, file_name); + if (file_name == NULL) { + usage(); + mxexit(0); + } + ok = process_file(file_name); + cleanup(); + + if (ok) + return 0; + else + return 1; +} + #if !defined HAVE_WXWINDOWS int main(int argc, char **argv) { - char *initial_file; - int res; - - setup(); - parse_args(argc, argv, initial_file); - - res = console_main(argc, argv); - cleanup(); - - return res; + return console_main(argc, argv); } #elif defined(SYS_UNIX) || defined(SYS_APPLE) @@ -1956,20 +1952,14 @@ int main(int argc, char **argv) { char *initial_file; - int res; - setup(); parse_args(argc, argv, initial_file); if (use_gui) { wxEntry(argc, argv); return 0; } else - res = console_main(argc, argv); - - cleanup(); - - return res; + return console_main(argc, argv); } #endif // HAVE_WXWINDOWS diff --git a/src/mkvinfo_gui.cpp b/src/mkvinfo_gui.cpp index 514aeabed..faafc3734 100644 --- a/src/mkvinfo_gui.cpp +++ b/src/mkvinfo_gui.cpp @@ -67,6 +67,7 @@ mi_app::OnInit() { return false; } + setup(); frame = new mi_frame(wxT("mkvinfo"), wxPoint(50, 50), wxSize(600, 400)); frame->Show(true); frame->Refresh(true);