From 1d7c668a4ae10a0ec4699c02e8dfad768dc75673 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 6 Jul 2020 12:14:50 -0500 Subject: [PATCH] Sanity-check value to prevent overflow. --- src/backends/winrt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/winrt.rs b/src/backends/winrt.rs index fa33458..8e502ae 100644 --- a/src/backends/winrt.rs +++ b/src/backends/winrt.rs @@ -60,7 +60,7 @@ impl Backend for WinRT { if state == MediaPlaybackState::Paused { let index = self.playback_list.current_item_index()?; let total = self.playback_list.items()?.size()?; - if index == total - 1 { + if total != 0 && index == total - 1 { self.playback_list.items()?.clear()?; } }