Fix panic when drawing empty image in iced_tiny_skia
This commit is contained in:
parent
4f6ccb78fe
commit
dd1ff34697
2 changed files with 7 additions and 0 deletions
|
|
@ -106,6 +106,10 @@ impl Cache {
|
|||
}
|
||||
};
|
||||
|
||||
if image.width() == 0 || image.height() == 0 {
|
||||
return Err(raster::Error::Empty);
|
||||
}
|
||||
|
||||
let mut buffer =
|
||||
vec![0u32; image.width() as usize * image.height() as usize];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue