weston/shared
Pekka Paalanen 091b1554da shared/cairo-util: fix leak from load_cairo_surface()
Fixes ASan reported leaks:

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f8266f2d330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7f8266c8589a  (/lib/x86_64-linux-gnu/libpixman-1.so.0+0x5089a)
    #2 0x7f8266c4ea77  (/lib/x86_64-linux-gnu/libpixman-1.so.0+0x19a77)
    #3 0x55fa7818f8e8 in load_png ../../git/weston/shared/image-loader.c:297
    #4 0x55fa7819039e in load_image ../../git/weston/shared/image-loader.c:423
    #5 0x55fa78187b3e in load_cairo_surface ../../git/weston/shared/cairo-util.c:354
    #6 0x55fa7815ff8a in background_draw ../../git/weston/clients/desktop-shell.c:779
    #7 0x55fa7817b2c2 in widget_redraw ../../git/weston/clients/window.c:4520
    #8 0x55fa7817b831 in surface_redraw ../../git/weston/clients/window.c:4578
    #9 0x55fa7817b9a7 in idle_redraw ../../git/weston/clients/window.c:4607
    #10 0x55fa78184ea4 in display_run ../../git/weston/clients/window.c:6527
    #11 0x55fa781646fb in main ../../git/weston/clients/desktop-shell.c:1556
    #12 0x7f826659709a in __libc_start_main ../csu/libc-start.c:308
    #13 0x55fa7815c0a9 in _start (/home/pq/build/weston-meson/clients/weston-desktop-shell+0x120a9)

Indirect leak of 8024 byte(s) in 1 object(s) allocated from:
    #0 0x7f8266f2d330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x55fa7818f5e7 in load_png ../../git/weston/shared/image-loader.c:275
    #2 0x55fa7819039e in load_image ../../git/weston/shared/image-loader.c:423
    #3 0x55fa78187b3e in load_cairo_surface ../../git/weston/shared/cairo-util.c:354
    #4 0x55fa7815ff8a in background_draw ../../git/weston/clients/desktop-shell.c:779
    #5 0x55fa7817b2c2 in widget_redraw ../../git/weston/clients/window.c:4520
    #6 0x55fa7817b831 in surface_redraw ../../git/weston/clients/window.c:4578
    #7 0x55fa7817b9a7 in idle_redraw ../../git/weston/clients/window.c:4607
    #8 0x55fa78184ea4 in display_run ../../git/weston/clients/window.c:6527
    #9 0x55fa781646fb in main ../../git/weston/clients/desktop-shell.c:1556
    #10 0x7f826659709a in __libc_start_main ../csu/libc-start.c:308
    #11 0x55fa7815c0a9 in _start (/home/pq/build/weston-meson/clients/weston-desktop-shell+0x120a9)

from the command

	ASAN_OPTIONS=fast_unwind_on_malloc=0,malloc_context_size=50 \
	LSAN_OPTIONS=suppressions=/home/pq/git/weston/.gitlab-ci/leak-sanitizer.supp \
	./tests/test-viewporter test_viewporter_bad_source_rect

by recording the pixman image as user data so it can be freed when the
surface is destroyed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-05-31 12:35:01 +03:00
..
cairo-util.c shared/cairo-util: fix leak from load_cairo_surface() 2021-05-31 12:35:01 +03:00
cairo-util.h xwm: Fix icon surface ownership 2018-02-09 17:01:09 +00:00
config-parser.c config-parser: use zalloc() 2020-11-27 14:44:10 +02:00
fd-util.h libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
file-util.c clients: Fix/resolved doxygen warnings 2019-06-25 14:05:54 +00:00
file-util.h file-util: allow specifying path separately in file_create_dated() 2018-02-09 15:16:07 +00:00
frame.c xwm: Fix icon surface ownership 2018-02-09 17:01:09 +00:00
helpers.h shared/helpers: fix ARRAY_COPY macro 2021-04-28 11:35:28 -03:00
image-loader.c image-loader: Fix undefined left shift in premultiply_data 2019-10-16 16:06:06 -04:00
image-loader.h shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
matrix.c Rename matrix.h to libweston/matrix.h 2019-04-18 12:31:46 +03:00
meson.build build: simplify include_directories 2019-10-04 17:14:22 +03:00
option-parser.c option-parser: Make bools boolean 2019-11-28 19:24:13 +00:00
os-compatibility.c shared: fix typos 2021-02-24 10:00:32 -05:00
os-compatibility.h shared: add read-only anonymous file abstraction 2019-11-01 02:44:58 +01:00
platform.h shared/platform: avoid build warning when building without gl-renderer 2019-07-26 13:47:15 +02:00
string-helpers.h string-helpers.h: Fix usage on musl libc 2016-09-24 11:55:58 +02:00
timespec-util.h timespec: Don't return value from void function 2019-06-11 11:31:04 +01:00
weston-drm-fourcc.h Add weston-drm-fourcc.h 2021-02-25 14:35:03 +02:00
weston-egl-ext.h shared: fix typos 2021-02-24 10:00:32 -05:00
xalloc.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
xalloc.h Rename zalloc.h to libweston/zalloc.h 2019-04-18 12:31:46 +03:00