summaryrefslogtreecommitdiff
path: root/rsvg-filter.c
Commit message (Collapse)AuthorAgeFilesLines
* s/colour/color - sorry, but this was all inconsistentFederico Mena Quintero2016-04-121-59/+59
|
* RsvgFilterPrimitive: use a single destructor for most subclasses2.40.14Federico Mena Quintero2016-03-301-176/+111
| | | | | | | Instead of duplicating code to free the superclass all over the place, use a single function. Also, remove a bit of the 'upself' idiom - it's unreadable.
* RsvgFilterPrimitiveComponentTransfer: add destructor; fix memory leakRon Hopper2016-03-301-2/+12
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=761728
* filter: Remove unused variablesBenjamin Otte2016-01-291-30/+0
|
* state: Resolve filters lazilyBenjamin Otte2015-10-221-27/+0
| | | | We're almost there resolving everything lazily...
* rsvg: Add rsvg_acquire_node()Benjamin Otte2015-10-221-2/+7
| | | | | | This function does proper recursion checks when looking up resources from URLs and thereby helps avoiding infinite loops when cyclic references span multiple types of elements.
* bgo#630732 - Fix out-of-bounds read in feComponentTransfer with tableValuesFederico Mena Quintero2015-10-211-4/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=630732
* bgo#700911 - Make sure the feComponentTransfer functions are actually usedFederico Mena Quintero2015-10-211-3/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=700911
* rsvg-filter: Use g_new() instead of g_malloc()Federico Mena Quintero2015-10-071-1/+1
|
* rsvg-filter.c: Avoid VLA UsageChun-wei Fan2015-09-251-1/+4
| | | | | | | | | | | In order to support building under Visual Studio and other C89 compilers, we need to avoid using VLAs, especially that VLAs are: -Most probably not going to be supported under any Visual Studio -It is now optional under C11, and there are concerns regarding its implementations in other C99-capable compilers. https://bugzilla.gnome.org/show_bug.cgi?id=753555
* filter: Plug a leakCarlos Garnacho2015-08-041-1/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=748608
* filter: Plug gaussian convolution matrix leakCarlos Garnacho2015-08-041-1/+2
| | | | | | The convolution matrix on the Y axis is leaked. https://bugzilla.gnome.org/show_bug.cgi?id=748608
* filter: Plug one more cairo context/surface leakCarlos Garnacho2015-08-041-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=748608
* bgo#748608 - Destroy cairo_t after useCarlos Garnacho2015-08-021-0/+1
| | | | Otherwise the cairo_t, and the surface it's created on are leaked.
* Gaussian blur: clip the blurred image to the filter effects regionFederico Mena Quintero2015-03-241-5/+24
|
* bgo#605875 - Gaussian blurred objects are sometimes missingFederico Mena Quintero2015-03-241-104/+494
| | | | | | | This replaces the blurring machinery with a real gaussian blur for small radiuses, and fixes box blurs for large radiuses. Based on a patch by Eduard Braun.
* Fix shadowed variablesFederico Mena Quintero2015-02-121-1/+1
|
* bgo#744270 - Fix uninitialized value in ↵Federico Mena Quintero2015-02-111-1/+1
| | | | | | | | rsvg_filter_primitive_displacement_map_render() Fixes https://bugzilla.gnome.org/show_bug.cgi?id=744270 Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Avoid overflow in gint multiplicationFederico Mena Quintero2015-02-061-4/+3
| | | | | | | | | | | | In the convolution matrix filter code, we read the orderx and ordery for the convolution matrix. However, multiplying them as gints may overflow. Found by fuzz testing when orderx = ordery = 65536 Fuzz testing kindly provided by Atte Kettunen <attekett@gmail.com> From librsvg-fuzz case rsvgconvert-060-3ef-705-f72.svg Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* bgo#703102 - Clip coordinates for rsvg_alpha_blt() in a more civilized fashionFederico Mena Quintero2015-02-061-64/+51
| | | | | | | | | | The source offsets were not being validated correctly, so we could easily do a read or write outside the bounds of the image surface. We now use a generic function to clip rectangles instead of doing it by hand. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703102 Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* introspection: add many missing nullable annotationsEvan Nemerson2014-06-101-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731182
* docs: use %, #, and @ more consistently for contants, types, and argsEvan Nemerson2014-06-101-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731182
* rsvg-filter: Remove a bogus NULL checkJasper St. Pierre2013-10-311-1/+1
| | | | We've already dereferenced name at this point.
* rsvg-filter: Don't overrun an array when given invalid inputsJasper St. Pierre2013-10-311-4/+6
| | | | Yikes. Just select R/G as defaults.
* rsvg-filter: Fix memory leakJasper St. Pierre2013-09-031-1/+1
|
* introspection: clean up lots of warnings emitted by g-ir-scannerEvan Nemerson2012-06-191-8/+13
|
* Fix variables that could be accessed uninitializedFelix Riemann2012-03-261-1/+0
| | | | | | Fix warnings when building with -Wuninitialized. Bug #672725.
* Add permission check before loading other filesChristian Persch2012-01-261-2/+2
| | | | | | Wrap _rsvg_io_acquire_* in _rsvg_handle_acquire_* that first checks whether the load should be allowed. For the moment, always allow the load; more restricted policies will be introduced in a follow-up commit.
* Simplify angle handlingChristian Persch2011-12-031-2/+2
|
* Plug a refount leakChristian Persch2011-12-031-0/+2
| | | | | | | | | | | | | | | | | | | | | ==9147== 691,200 bytes in 1 blocks are possibly lost in loss record 5,494 of 5,494 ==9147== at 0x4029467: calloc (vg_replace_malloc.c:467) ==9147== by 0x518BB09: _pixman_bits_image_init (pixman-bits-image.c:1437) ==9147== by 0x518BBD7: pixman_image_create_bits (pixman-bits-image.c:1503) ==9147== by 0x499CD4E: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:329) ==9147== by 0x499CE14: cairo_image_surface_create (cairo-image-surface.c:379) ==9147== by 0x403EA89: _rsvg_image_surface_new (rsvg-filter.c:160) ==9147== by 0x404112B: rsvg_filter_primitive_offset_render (rsvg-filter.c:1618) ==9147== by 0x4049D6F: rsvg_filter_render (rsvg-filter.c:86) ==9147== 460 (288 direct, 172 indirect) bytes in 1 blocks are definitely lost in loss record 5,205 of 5,494 ==9147== at 0x402AD89: malloc (vg_replace_malloc.c:236) ==9147== by 0x4999F1A: _cairo_image_surface_create_for_pixman_image (cairo-image-surface.c:158) ==9147== by 0x499CD60: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:335) ==9147== by 0x499CE14: cairo_image_surface_create (cairo-image-surface.c:379) ==9147== by 0x403EA89: _rsvg_image_surface_new (rsvg-filter.c:160) ==9147== by 0x404112B: rsvg_filter_primitive_offset_render (rsvg-filter.c:1618) ==9147== by 0x4049D6F: rsvg_filter_render (rsvg-filter.c:86)
* Add NULL checksChristian Persch2011-12-031-3/+125
|
* Fix refcount problemChristian Persch2011-11-291-1/+1
| | | | | Need to reference the source surface put into the results stack. This fixes a regression introduced in commit 1b3d2ea55a1be67e0548bf76903ff905888e2e18.
* Flush the surface before accessing its pixelsChristian Persch2011-11-271-2/+39
|
* NULL check before dereferenceChristian Persch2011-11-271-1/+1
| | | | ... not afterwards!
* Use cairo image surfacesChristian Persch2011-11-271-348/+378
| | | | ... instead of GdkPixbufs to store the filter results.
* Make _rsvg_pixbuf_new_cleared static and remove always-same parametersChristian Persch2011-11-271-21/+20
|
* Make some functions staticChristian Persch2011-11-261-2/+2
|
* Make filters render to a surfaceChristian Persch2011-11-261-11/+49
| | | | ... instead of into a GdkPixbuf.
* filter: The blur filter was not rendered correctly when scaled to certain sizes.Isak2011-11-091-2/+2
| | | | Two for-loops was missing their initial expression in the box_blur function.
* Don't create pixbufs with zero width or heightChristian Persch2011-11-091-6/+9
| | | | | | | | | | | | This created lots and lots of critical warnings when rendering tests/svg1.1/svg/filters-displace-01-f.svg: GdkPixbuf-CRITICAL **: gdk_pixbuf_new: assertion `width > 0' failed g_logv() [gmessages.c:779] g_log() [gmessages.c:826] g_return_if_fail_warning() [gmessages.c:838] gdk_pixbuf_new() [gdk-pixbuf.c:338] rsvg_filter_primitive_image_render_ext() [rsvg-filter.c:3376]
* Fix crash on invalid kernelMatrix attributeKurosawa Takeshi2011-11-091-3/+4
| | | | | | The image will now not crash librsvg, but doesn't render at all. https://bugzilla.gnome.org/show_bug.cgi?id=624835
* Fix unused-but-set-variable warningsChristian Persch2011-11-071-14/+2
|
* Pass pointer to structChristian Persch2011-11-071-6/+6
|
* Avoid repeatedly calculating floor and ceil values hereChristian Persch2011-11-071-12/+18
|
* Use cairo_matrix_tChristian Persch2011-11-071-79/+78
| | | | | I've checked this quite carefully, but it still might contain stupid typo bugs ;-)
* Use cairo_rectangle_tChristian Persch2011-11-071-23/+23
|
* Initialise GString member to NULLChristian Persch2011-11-071-0/+1
| | | | Otherwise we get an invalid read when freeing this node.
* Stop console pollutionChristian Persch2011-11-071-1/+1
|
* Add RsvgRender type checkingChristian Persch2011-11-071-1/+1
|
* Store node type separately in RsvgNodeChristian Persch2011-09-061-37/+42
| | | | | | | | | | | | The node name (formerly RsvgNode:type) cannot be used to infer the sub-type of RsvgNode that we're dealing with, since for unknown elements we put type = node-name. This lead to a (potentially exploitable) crash e.g. when the element name started with "fe" which tricked the old code into considering it as a RsvgFilterPrimitive. CVE-2011-3146 https://bugzilla.gnome.org/show_bug.cgi?id=658014