Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
πŸ› Fix: lagi: Don't close iconv_t if it is iconv_invalid
Browse files Browse the repository at this point in the history
When certain iconv_t is invalid, iconv_invalid(0xfffffffffffffffffffffff) will be returned. Passing it to iconv_close will cause a SIGSEGV.
  • Loading branch information
cqjjjzr authored and wangqr committed Nov 3, 2019
1 parent f24fe92 commit 0f96888
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libaegisub/common/charset_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0f96888

Please sign in to comment.