roundedcorners: Ensure alpha_mem is mutable when updating radius

The `get_mut()` function can return None when the memory is not writable, so
instead, make sure the memory is writable by using `make_mut()`.

Fixes #214
This commit is contained in:
Philippe Normand 2022-06-30 17:50:40 +01:00 committed by Arun Raghavan
parent d867ef9dee
commit c6238a6a9f

View file

@ -115,7 +115,7 @@ impl RoundedCorners {
let alpha_stride = out_info.stride()[3];
let mem = &mut state.alpha_mem;
let mut_mem = mem.get_mut().unwrap();
let mut_mem = mem.make_mut();
let mut alpha_mem = mut_mem
.map_writable()