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:
Alex James 2023-08-14 19:49:10 -05:00 committed by arch1t3cht
parent 47c923d4ed
commit 4f67db8dd7
1 changed files with 1 additions and 1 deletions

View File

@ -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;
if (supported) iconv_close(cd);
return supported;