Skip to content

Commit ba33b43

Browse files
author
JerryShih
committed
Show panic if we try to call update() for external image.
1 parent 5606b5a commit ba33b43

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webrender/src/resource_cache.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ impl ResourceCache {
275275
bytes: Vec<u8>) {
276276
let next_epoch = match self.image_templates.get(&image_key) {
277277
Some(image) => {
278+
// This image should not be an external image.
279+
match image.data {
280+
ImageData::External(id) => {
281+
panic!("Update an external image with buffer, id={} image_key={:?}", id.0, image_key);
282+
},
283+
_ => {},
284+
}
285+
278286
let Epoch(current_epoch) = image.epoch;
279287
Epoch(current_epoch + 1)
280288
}

0 commit comments

Comments
 (0)