filter-color-grade: Fix crash if color-grade.effect is missing

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-08-04 23:20:35 +02:00
parent 71b223dcb5
commit f5b4c1f7a1

View file

@ -375,13 +375,17 @@ filter::color_grade::color_grade_instance::color_grade_instance(obs_data_t* data
{ {
char* file = obs_module_file("effects/color-grade.effect"); char* file = obs_module_file("effects/color-grade.effect");
try { if (file) {
_effect = gs::effect::create(file); try {
bfree(file); _effect = gs::effect::create(file);
} catch (std::runtime_error& ex) { bfree(file);
P_LOG_ERROR("<filter-color-grade> Loading _effect '%s' failed with error(s): %s", file, ex.what()); } catch (std::runtime_error& ex) {
bfree(file); P_LOG_ERROR("<filter-color-grade> Loading _effect '%s' failed with error(s): %s", file, ex.what());
throw ex; bfree(file);
throw ex;
}
} else {
throw std::runtime_error("Missing file color-grade.effect.");
} }
} }
{ {