]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix transparency parsing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Jul 2021 11:59:22 +0000 (12:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Jul 2021 11:59:22 +0000 (12:59 +0100)
src/libserver/css/css_value.cxx

index 704905cd48a5879592cbcb5ead5040544dcfba5f..6982647f4564018b825f1d3f15085445de6978e6 100644 (file)
@@ -147,14 +147,14 @@ constexpr static inline auto alpha_component_convert(const css_parser_token &tok
                        ret = (dbl / 100.0);
                }
                else {
-                       if (dbl > 255) {
-                               dbl = 255;
+                       if (dbl > 1.0) {
+                               dbl = 1.0;
                        }
                        else if (dbl < 0) {
                                dbl = 0;
                        }
 
-                       ret = dbl / 255.0;
+                       ret = dbl;
                }
        }