Skip to content

Commit

Permalink
fix: sanitise Pip window size
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Apr 13, 2024
1 parent 453c79f commit ad53734
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@
if (pip) {
canvasVideo.requestPictureInPicture().then(pipwindow => {
pipwindow.onresize = () => {
subs.renderer.resize(pipwindow.width, pipwindow.height)
const { width, height } = pipwindow
if (isNaN(width) || isNaN(height)) return
if (!isFinite(width) || !isFinite(height)) return
subs.renderer.resize(width, height)
}
}).catch(e => {
cleanup()
Expand Down

0 comments on commit ad53734

Please sign in to comment.