Skip to content

Commit 8c1495a

Browse files
committed
Check image size
1 parent 230c6a7 commit 8c1495a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sparse_strips/vello_api/src/paint.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ impl From<Gradient> for PaintType {
112112

113113
impl From<Image> for PaintType {
114114
fn from(value: Image) -> Self {
115+
assert!(
116+
value.width < u16::MAX as u32 && value.height < u16::MAX as u32,
117+
"the image is too big, the width and height can be no larger than {}px",
118+
u16::MAX,
119+
);
115120
Self::Image(value)
116121
}
117122
}

0 commit comments

Comments
 (0)