fix no audio issue with sample rate >= 48000 and strange crash issue

(there is some overflow in unsafe code, will test again)
This commit is contained in:
rustdesk
2021-05-13 00:24:38 +08:00
parent 5b2c1eea75
commit 7630713534
2 changed files with 5 additions and 3 deletions

View File

@@ -105,6 +105,9 @@ pub fn get_cursor_data(hcursor: u64) -> ResultType<CursorData> {
bm_mask.bmHeight / 2
};
let cbits_size = width * height * 4;
if cbits_size < 16 {
bail!("Invalid icon: too small"); // solve some crash
}
let mut cbits: Vec<u8> = Vec::new();
cbits.resize(cbits_size as _, 0);
let mut mbits: Vec<u8> = Vec::new();