Fix: prevent integer overflow when calculating cache size

Fixes #823
This commit is contained in:
Henrik Friedrichsen
2022-06-08 19:30:51 +02:00
parent 0c8db9253a
commit ce6b360cba

View File

@@ -145,7 +145,7 @@ impl Spotify {
Some(librespot_cache_path.join("volume")),
cfg.values()
.audio_cache_size
.map(|size| (size * 1048576) as u64),
.map(|size| (size as u64 * 1048576)),
)
.expect("Could not create cache");
debug!("opening spotify session");