mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add check for empty data on ImageData constructor.
This commit is contained in:
parent
6ca62aa0de
commit
7d7c46cbc9
2 changed files with 1 additions and 6 deletions
|
@ -76,7 +76,7 @@ impl ImageData {
|
|||
})?;
|
||||
|
||||
let byte_len = array.as_slice().len() as u32;
|
||||
if byte_len % 4 != 0 {
|
||||
if byte_len % 4 != 0 || byte_len == 0 {
|
||||
return Err(Error::InvalidState);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue