Skip to content

Commit e4c846a

Browse files
author
bors-servo
authored
Auto merge of #1768 - glennw:fix-overflow, r=nical
Cull primitives with invalid dimensions, to avoid overflow later. Primitives with invalid dimensions can cause overflow and general badness in the texture and render task allocators. Detect them and ensure they are not considered visible. Fixes servo/servo#18655 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1768) <!-- Reviewable:end -->
2 parents 64c79f2 + 1f27f8e commit e4c846a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webrender/src/prim_store.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,12 @@ impl PrimitiveStore {
10751075
let metadata = &mut self.cpu_metadata[prim_index.0];
10761076
metadata.screen_rect = None;
10771077

1078+
if metadata.local_rect.size.width <= 0.0 ||
1079+
metadata.local_rect.size.height <= 0.0 {
1080+
warn!("invalid primitive rect {:?}", metadata.local_rect);
1081+
return None;
1082+
}
1083+
10781084
if !metadata.is_backface_visible &&
10791085
prim_context.packed_layer.transform.is_backface_visible() {
10801086
return None;

0 commit comments

Comments
 (0)