commit 3206cbd: [Minor] Fix transparency parsing

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jul 29 12:28:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-29 12:59:22 +0100
URL: https://github.com/rspamd/rspamd/commit/3206cbd412877e47d60e24eaabc469d230fc11df

[Minor] Fix transparency parsing

---
 src/libserver/css/css_value.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libserver/css/css_value.cxx b/src/libserver/css/css_value.cxx
index 704905cd4..6982647f4 100644
--- a/src/libserver/css/css_value.cxx
+++ b/src/libserver/css/css_value.cxx
@@ -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;
 		}
 	}
 


More information about the Commits mailing list