mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-27 22:03:01 +00:00
filter/denoising: Restrict size to reasonable numbers
Prevents invalid sizes from being used by the filter, which sometimes happens with Async Sources that aren't quite ready yet. Fixes: #642
This commit is contained in:
parent
c2955d8480
commit
45cedde1ae
1 changed files with 6 additions and 1 deletions
|
@ -180,10 +180,15 @@ uint32_t streamfx::filter::denoising::denoising_instance::get_height()
|
||||||
|
|
||||||
void denoising_instance::video_tick(float_t time)
|
void denoising_instance::video_tick(float_t time)
|
||||||
{
|
{
|
||||||
|
auto parent = obs_filter_get_parent(_self);
|
||||||
auto target = obs_filter_get_target(_self);
|
auto target = obs_filter_get_target(_self);
|
||||||
auto width = obs_source_get_base_width(target);
|
auto width = obs_source_get_base_width(target);
|
||||||
auto height = obs_source_get_base_height(target);
|
auto height = obs_source_get_base_height(target);
|
||||||
|
|
||||||
|
// Verify that the detected size makes sense.
|
||||||
|
if ((width > 0) && (height > 0)) {
|
||||||
_size = {width, height};
|
_size = {width, height};
|
||||||
|
}
|
||||||
|
|
||||||
// Allow the provider to restrict the size.
|
// Allow the provider to restrict the size.
|
||||||
if (target && _provider_ready) {
|
if (target && _provider_ready) {
|
||||||
|
|
Loading…
Reference in a new issue