summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Drake <Michael Drake tlsa@netsurf-browser.org>2020-02-24 10:28:58 +0000
committerMichael Drake <Michael Drake tlsa@netsurf-browser.org>2020-02-24 10:28:58 +0000
commit6be78419e673c7aaac7143d1dafaa6a4a747b32d (patch)
tree9d353dac45b6b2c9c28df0413abda4d08c9bb4b5 /src
parent1be9823782a6a900f035186138586b3ab800c2b2 (diff)
downloadlibcss-6be78419e673c7aaac7143d1dafaa6a4a747b32d.tar.gz
libcss-6be78419e673c7aaac7143d1dafaa6a4a747b32d.tar.bz2
Computed styles: Check length pair getter type before using result.
Fixes use of garbage value scan-build issue.
Diffstat (limited to 'src')
-rw-r--r--src/select/computed.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 24d188e..4e5588a 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -1743,6 +1743,10 @@ css_error compute_absolute_length_pair(css_computed_style *style,
type = get(style, &length1, &unit1, &length2, &unit2);
+ if (type != CSS_BACKGROUND_POSITION_SET) {
+ return CSS_OK;
+ }
+
if (unit1 == CSS_UNIT_EX) {
length1 = FMUL(length1, ex_size->value);
unit1 = ex_size->unit;