Merge pull request #52 from kusano/fix-crash

Fix crash in initializing
This commit is contained in:
roentgen 2016-03-27 01:55:59 +09:00
commit c26f34a66e

View file

@ -1061,11 +1061,19 @@ Tiio::AviWriterProperties::AviWriterProperties()
if (!rc)
break;
HIC hic = 0;
#ifdef _MSC_VER
[&](){
__try {
hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE_QUERY);
} __except (EXCEPTION_EXECUTE_HANDLER) {
}
}();
#else
try {
hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE_QUERY);
} catch (...) {
continue;
}
#endif
if (hic) {
if (ICGetInfo(hic, &icinfo, sizeof(ICINFO)) == 0) // Find out the compressor name
{