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:
Michael Fabian 'Xaymar' Dirks 2021-10-05 22:48:27 +02:00
parent c2955d8480
commit 45cedde1ae
1 changed files with 6 additions and 1 deletions

View File

@ -180,10 +180,15 @@ uint32_t streamfx::filter::denoising::denoising_instance::get_height()
void denoising_instance::video_tick(float_t time)
{
auto parent = obs_filter_get_parent(_self);
auto target = obs_filter_get_target(_self);
auto width = obs_source_get_base_width(target);
auto height = obs_source_get_base_height(target);
// Verify that the detected size makes sense.
if ((width > 0) && (height > 0)) {
_size = {width, height};
}
// Allow the provider to restrict the size.
if (target && _provider_ready) {