diff --git a/vlib/gg/image.v b/vlib/gg/image.v index 18855699c4..2d2e3130de 100644 --- a/vlib/gg/image.v +++ b/vlib/gg/image.v @@ -108,6 +108,10 @@ pub fn (mut img Image) init_sokol_image() &Image { } pub fn (ctx &Context) draw_image(x, y, width, height f32, img_ &Image) { + if img_.id >= ctx.image_cache.len { + eprintln('gg: draw_image() bad img id $img_.id (img cache len = $ctx.image_cache.len)') + return + } img := ctx.image_cache[img_.id] // fetch the image from cache if !img.simg_ok { return diff --git a/vlib/net/html/tag.v b/vlib/net/html/tag.v index 6a48628f93..85d12afd49 100644 --- a/vlib/net/html/tag.v +++ b/vlib/net/html/tag.v @@ -7,12 +7,13 @@ enum CloseTagType { [ref_only] pub struct Tag { -mut: - name string = '' - attributes map[string]string // attributes will be like map[name]value - last_attribute string = '' - content string = '' +pub mut: + name string + content string children []&Tag +mut: + attributes map[string]string // attributes will be like map[name]value + last_attribute string parent &Tag = C.NULL position_in_parent int = 0 closed bool = false