Fix crash in initializing

In some enviroment, access violations occures in ICOpen.
Althogh this code seems to intended to handle SEH, structured exceptions are not catched in current configulation.
This commit is contained in:
kusano 2016-03-27 01:02:54 +09:00
parent 7e185111a8
commit ffc911474d

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
{