From e5ff6cd23d40261597a4befe911dd9d658a56306 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 13 Jun 2022 02:01:26 -0700 Subject: [PATCH] [Position Slider] Fix invalid duration setting Fix NaN condition occurring when an invalid file is played. Signed-off-by: Christopher Snowhill --- Window/PositionSlider.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Window/PositionSlider.m b/Window/PositionSlider.m index b2e3f62c0..3ed33e936 100644 --- a/Window/PositionSlider.m +++ b/Window/PositionSlider.m @@ -18,6 +18,8 @@ } - (void)setMaxValue:(double)value { + if(isnan(value) || isinf(value)) value = 0.0; // Clip invalid values from bad file playlist entries + self.positionTextField.duration = (long)value; [super setMaxValue:value];