libaegisub: Avoid calling iconv_close(iconv_invalid)
IsConversionSupported unconditionally calls iconv_close on the descriptor returned by iconv_open. This may result in crashes if iconv_open returns iconv_invalid.
This commit is contained in:
parent
47c923d4ed
commit
4f67db8dd7
1 changed files with 1 additions and 1 deletions
|
@ -420,7 +420,7 @@ size_t IconvWrapper::DstStrLen(const char* str) {
|
|||
bool IsConversionSupported(const char *src, const char *dst) {
|
||||
iconv_t cd = iconv_open(dst, src);
|
||||
bool supported = cd != iconv_invalid;
|
||||
iconv_close(cd);
|
||||
if (supported) iconv_close(cd);
|
||||
return supported;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue