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;
|
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);
|
return Err(Error::InvalidState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[2d.imageData.object.ctor.array.bounds.html]
|
|
||||||
type: testharness
|
|
||||||
[ImageData has a usable constructor]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue