diff options
author | Rob Bradford <rob@linux.intel.com> | 2012-05-22 18:48:14 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-22 15:50:26 -0400 |
commit | 3cc187c73ef73cd345138fd746344299f94933e8 (patch) | |
tree | 1af0e335a6dd234d7f1afbec2b2a0858795d5234 /src/wayland-shm.c | |
parent | 1323b074c38182f9682d1f6a8ed07dd66d6ec4b8 (diff) |
shm: Zero busy count for allocated buffers
This avoids a valgrind error like:
==31496== Conditional jump or move depends on uninitialised value(s)
==31496== at 0x407620: weston_buffer_post_release (compositor.c:928)
==31496== by 0x406AEB: weston_surface_attach (compositor.c:725)
==31496== by 0x409EB8: pointer_attach (compositor.c:2009)
==31496== by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496== by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496== by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496== by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496== by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496== by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496== by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496== by 0x40C775: main (compositor.c:2937)
==31496== Uninitialised value was created by a heap allocation
==31496== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==31496== by 0x5670EA7: shm_pool_create_buffer (wayland-shm.c:113)
==31496== by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496== by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496== by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496== by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496== by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496== by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496== by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496== by 0x40C775: main (compositor.c:2937)
Diffstat (limited to 'src/wayland-shm.c')
-rw-r--r-- | src/wayland-shm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wayland-shm.c b/src/wayland-shm.c index 8a8a671..e071392 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -120,6 +120,7 @@ shm_pool_create_buffer(struct wl_client *client, struct wl_resource *resource, buffer->buffer.width = width; buffer->buffer.height = height; + buffer->buffer.busy_count = 0; buffer->format = format; buffer->stride = stride; buffer->offset = offset; |