From 7101aecc98aa80291c231e2c7a9425aef60cece4 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 26 Dec 2025 23:49:30 +0100 Subject: [PATCH] Try to prevent invalid aspectRatio of SurfaceView If the video's hieght is 0, the aspectRatio is set to Float.NaN which can cause further issues. Do not assign invalid values for the aspectRatio. --- .../java/org/schabi/newpipe/views/ExpandableSurfaceView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/views/ExpandableSurfaceView.java b/app/src/main/java/org/schabi/newpipe/views/ExpandableSurfaceView.java index 36380b650..7452fff09 100644 --- a/app/src/main/java/org/schabi/newpipe/views/ExpandableSurfaceView.java +++ b/app/src/main/java/org/schabi/newpipe/views/ExpandableSurfaceView.java @@ -100,7 +100,7 @@ public class ExpandableSurfaceView extends SurfaceView { } public void setAspectRatio(final float aspectRatio) { - if (videoAspectRatio == aspectRatio) { + if (videoAspectRatio == aspectRatio || aspectRatio == 0 || !Float.isFinite(aspectRatio)) { return; }