diff options
author | Michael Drake <Michael Drake tlsa@netsurf-browser.org> | 2020-02-24 10:28:58 +0000 |
---|---|---|
committer | Michael Drake <Michael Drake tlsa@netsurf-browser.org> | 2020-02-24 10:28:58 +0000 |
commit | 6be78419e673c7aaac7143d1dafaa6a4a747b32d (patch) | |
tree | 9d353dac45b6b2c9c28df0413abda4d08c9bb4b5 /src | |
parent | 1be9823782a6a900f035186138586b3ab800c2b2 (diff) | |
download | libcss-6be78419e673c7aaac7143d1dafaa6a4a747b32d.tar.gz |
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.c | 4 |
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; |