diff options
author | morpheus65535 <[email protected]> | 2023-03-21 23:15:01 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-03-21 23:15:01 -0400 |
commit | 7455496c4c42518df5f20646d50a93ca66c1a912 (patch) | |
tree | f7992557e15e6d8c8494edb2789772aa4b0dce44 /libs/knowit/properties | |
parent | 71363830985a34f5f45a32972477e0ac83dce519 (diff) | |
download | bazarr-7455496c4c42518df5f20646d50a93ca66c1a912.tar.gz bazarr-7455496c4c42518df5f20646d50a93ca66c1a912.zip |
Trying to fix Segmentation fault caused by mediainfo in docker container. #2098v1.2.1-beta.9
Diffstat (limited to 'libs/knowit/properties')
-rw-r--r-- | libs/knowit/properties/video.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/knowit/properties/video.py b/libs/knowit/properties/video.py index e1b293d01..60c5b8264 100644 --- a/libs/knowit/properties/video.py +++ b/libs/knowit/properties/video.py @@ -106,11 +106,12 @@ class Ratio(Property[Decimal]): if (width, height) == ('0', '1'): # identity return Decimal('1.0') - result = round_decimal(Decimal(width) / Decimal(height), min_digits=1, max_digits=3) - if self.unit: - result *= self.unit + if height: + result = round_decimal(Decimal(width) / Decimal(height), min_digits=1, max_digits=3) + if self.unit: + result *= self.unit - return result + return result self.report(value, context) return None |