rsvg-convert should print a good error message when fed an SVG with too-big dimensions
The attached SVG has a viewport with
width="161953" height="134875". rsvg-convert gives this:
(rsvg-convert:12302): librsvg-WARNING **: 12:00:27.096: cannot render on a cairo_t with a failure status (status="invalid value (typically too big) for the size of the input (surface, pattern, etc.)") Could not render file ../viewport-with-offsets/librsvg_crate/big.svg
This is bad because the librsvg-WARNING indicates a programming error: librsvg is being fed a cairo_t from a surface in an error state.
I think the following happens:
- rsvg-convert asks librsvg for the SVG's size
- librsvg returns big numbers
- rsvg-convert tries to create a surface of that size; Cairo returns an error surface
- rsvg-convert asks librsvg to render to a cr for that surface
- librsvg emits the warning, returns an error
- rsvg-convert prints "Could not render file ..."
Rsvg-convert should check the result of all the Cairo functions that create a surface, and print an appropriate error if the request was too big for Cairo.