It's 3.30.1 release day, upload a tarball and enjoy the fixes of those pesky bugs 🐛

  • Federico Mena Quintero's avatar
    (#344): Don't let a viewBox with overflowing numbers pass through · 7b440303
    Federico Mena Quintero authored
    This commit adds expect_finite_number() and finite_f32() to parsers.rs.
    
    Part of issue #344 is that we need to validate parsed numbers, as
    cssparser can give us back -inf or inf when it overflows.  These
    values ripple down the code and end up creating a NaN inside a
    cairo::Matrix, which makes it invalid.
    
    This commit introduces a CssParserExt trait to have an
    expect_finite_number() method for cssparser::Parser, and the
    corresponding, low-level finite_f32() validation function.
    
    Those functions return a Result<f32, ValueErrorKind>.  This commit
    makes the following return a ValueErrorKind for the error case as
    well:
    
    * impl Parse for f64
    * parsers::number()
    * parsers::number_optional_number()
    * parsers:;integer()
    * parsers::integer_optional_integer()
    
    This has implications in all the callers, since they used to expect a
    ParseError, but must now expect ValueErrorKind.
    
    The biggest change is in transform.rs.  For simplicity, the individual
    parsers for transform functions now have two sections:  the first
    extracts f32 from cssparser::Parser, and the second validates those
    numbers and computes the final result --- instead of doing everything
    at the same time.
    
    #344
    7b440303
Name
Last commit
Last update
..
fixtures Loading commit data...
resources Loading commit data...
Makefile.am Loading commit data...
README.md Loading commit data...
api.c Loading commit data...
crash.c Loading commit data...
dimensions.c Loading commit data...
errors.c Loading commit data...
infinite-loop.c Loading commit data...
loading.c Loading commit data...
render-crash.c Loading commit data...
rsvg-test.c Loading commit data...
styles.c Loading commit data...
test-utils.c Loading commit data...
test-utils.h Loading commit data...