Skip to content

Commit c62db16

Browse files
committed
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.
1 parent a6ed22d commit c62db16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/org/schabi/newpipe/views/ExpandableSurfaceView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public int getResizeMode() {
100100
}
101101

102102
public void setAspectRatio(final float aspectRatio) {
103-
if (videoAspectRatio == aspectRatio) {
103+
if (videoAspectRatio == aspectRatio || aspectRatio == 0 || !Float.isFinite(aspectRatio)) {
104104
return;
105105
}
106106

0 commit comments

Comments
 (0)