Skip to content

Commit

Permalink
bore: Ensure ignore_mask is always float
Browse files Browse the repository at this point in the history
`ignore_mask` causes the following error if it's passed at 8bit:

```
VapourSynth encountered a fatal error: Filter  returned a frame that's not of the declared format
```

And silently crashes VS instead if it's neither 8bit nor float.
  • Loading branch information
LightArrowsEXE committed Jul 2, 2024
1 parent 166b78c commit 3448ef4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vsadjust/borders.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from itertools import chain
from typing import Sequence

from vstools import CustomEnum, CustomValueError, FunctionUtil, KwargsT, NotFoundEnumValue, PlanesT, core, vs
from vstools import CustomEnum, CustomValueError, FunctionUtil, KwargsT, NotFoundEnumValue, PlanesT, core, depth, vs

__all__ = [
'bore'
Expand Down Expand Up @@ -58,6 +58,9 @@ def __call__(
'Invalid Bore enum!', func.func, dict(member=self, valid_function=bore.__members__.keys())
)

if kwargs.get('ignore_mask', False):
kwargs['ignore_mask'] = depth(kwargs['ignore_mask'], func.bitdepth) # type:ignore

proc_clip: vs.VideoNode = func.work_clip

for plane in func.norm_planes:
Expand Down

0 comments on commit 3448ef4

Please sign in to comment.