• Federico Mena Quintero's avatar
    gitlab#323 - Limit the number of instancings through the <use> element · a9ca82a5
    Federico Mena Quintero authored
    A pathological SVG file can do this:
    
    <svg>
      <defs>
        <rect id="foo" .../>
    
        <g id="foo1">
          <use xlink:href="#foo"/>
          ... repeat 10 times ...
        </g>
    
        <g id="foo2">
            <use xlink:href="#foo1"/>
            ... repeat 10 times ...
        </g>
    
        <g id="foo3">
            <use xlink:href="#foo2"/>
            ... repeat 10 times ...
        </g>
    
        ... etc ...
      </defs>
    
      <use xlink:href="#foo17"/>
    </svg>
    
    This would cause about 10^17 objects to be rendered.  While this does
    not exhaust memory (the objects are not instanced in memory), it would
    take a really long time to render that many objects.
    
    So, we now have a limit on up to 500,000 objects instanced through
    <use>.  We can tweak this limit later, or the way in which it is
    computed; the point is that we can now detect this situation and
    propagate an error upstream.
    
    #323
    a9ca82a5
Name
Last commit
Last update
doc Loading commit data...
gdk-pixbuf-loader Loading commit data...
librsvg Loading commit data...
m4 Loading commit data...
rsvg_internals Loading commit data...
tests Loading commit data...
tools Loading commit data...
win32 Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
.rustfmt.toml Loading commit data...
ARCHITECTURE.md Loading commit data...
AUTHORS Loading commit data...
COMPILING.md Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
COPYING.LIB Loading commit data...
Cargo.lock Loading commit data...
Cargo.toml Loading commit data...
ChangeLog.old Loading commit data...
INSTALL Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
Rsvg-2.0-custom.vala Loading commit data...
Rsvg-2.0.metadata Loading commit data...
acinclude.m4 Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
cargo-vendor-config Loading commit data...
code-of-conduct.md Loading commit data...
config.h.win32.in Loading commit data...
configure.ac Loading commit data...
glib-tap.mk Loading commit data...
librsvg-uninstalled.pc.in Loading commit data...
librsvg-zip.in Loading commit data...
librsvg.doap Loading commit data...
librsvg.pc.in Loading commit data...
rsvg-convert.1 Loading commit data...
rsvg-convert.c Loading commit data...
rsvg-view.c Loading commit data...
rsvg.symbols Loading commit data...
tap-driver.sh Loading commit data...
tap-test Loading commit data...