Skip to content

Commit 7101aec

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 718335d commit 7101aec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)