mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
Fixed a segfault if iconv could not be initialized.
This commit is contained in:
parent
9446c2958e
commit
047055706f
@ -13,7 +13,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version \$Id: common.cpp,v 1.17 2003/05/09 05:26:02 mosu Exp $
|
||||
\version \$Id: common.cpp,v 1.18 2003/05/09 06:08:53 mosu Exp $
|
||||
\brief helper functions, common variables
|
||||
\author Moritz Bunkus <moritz @ bunkus.org>
|
||||
*/
|
||||
@ -152,6 +152,9 @@ static char *convert_charset(iconv_t ict, char *src) {
|
||||
size_t lsrc, ldst;
|
||||
int len;
|
||||
|
||||
if (ict == (iconv_t)(-1))
|
||||
return safestrdup(src);
|
||||
|
||||
len = strlen(src) * 4;
|
||||
dst = (char *)safemalloc(len + 1);
|
||||
memset(dst, 0, len + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user