[mutter/wayland] MonitorManager: make sure to pass the right sizes to vararg functions
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wayland] MonitorManager: make sure to pass the right sizes to vararg functions
- Date: Wed, 9 Apr 2014 20:04:09 +0000 (UTC)
commit 42f267bb5097ba6b35f610c3dae9284966d9a181
Author: Giovanni Campagna <gcampagn redhat com>
Date: Mon Sep 2 09:29:26 2013 +0200
MonitorManager: make sure to pass the right sizes to vararg functions
A gulong is not enough to get 64 bits in all arches, so we must
cast it, or we can corrupt the stack.
This was downstream bug bugzilla.redhat.com/show_bug.cgi?id=1002055
https://bugzilla.gnome.org/show_bug.cgi?id=707267
src/backends/meta-monitor-manager.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 3e0a238..a437c5f 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -536,13 +536,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})",
i, /* ID */
- crtc->crtc_id,
+ (gint64)crtc->crtc_id,
(int)crtc->rect.x,
(int)crtc->rect.y,
(int)crtc->rect.width,
(int)crtc->rect.height,
(int)(crtc->current_mode ? crtc->current_mode - manager->modes : -1),
- crtc->transform,
+ (guint32)crtc->transform,
&transforms,
NULL /* properties */);
}
@@ -613,7 +613,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
i, /* ID */
- output->output_id,
+ (gint64)output->output_id,
(int)(output->crtc ? output->crtc - manager->crtcs : -1),
&crtcs,
output->name,
@@ -628,9 +628,9 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&mode_builder, "(uxuud)",
i, /* ID */
- mode->mode_id,
- mode->width,
- mode->height,
+ (gint64)mode->mode_id,
+ (guint32)mode->width,
+ (guint32)mode->height,
(double)mode->refresh_rate);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]