From 45486090c689ac8971b7e5471c04896cb81d470b Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 24 Aug 2024 20:11:58 +0200 Subject: [PATCH] [css] Check NULL --- src/document/libdom/css.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/document/libdom/css.c b/src/document/libdom/css.c index 21cfa730..5ca52d58 100644 --- a/src/document/libdom/css.c +++ b/src/document/libdom/css.c @@ -2135,6 +2135,10 @@ select_css(struct html_context *html_context, struct html_element *html_element) return; } + if (!style->styles[CSS_PSEUDO_ELEMENT_NONE]) { + goto end; + } + color_type = css_computed_color( style->styles[CSS_PSEUDO_ELEMENT_NONE], &color_shade); @@ -2199,6 +2203,7 @@ fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__); apply_text_align(html_context, html_element, text_align); } +end: code = css_select_results_destroy(style); if (code != CSS_OK) { fprintf(stderr, "css_computed_style_destroy code=%d\n", code);