diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 14:34:48 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 14:35:29 +0000 |
commit | 5079830bd5f01740c4cbf84888bdf7a93bb2868e (patch) | |
tree | 57dcfa7a60483064a8b82fd8462e93ca536557d9 /tools | |
parent | c64d2572bafeacae25e9b58c8372ce91858c3832 (diff) |
intel-virtual-output: Mode names are freed with ScreenResources
So we have to be careful not to continue to reference the strings after
they may be freed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virtual.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/virtual.c b/tools/virtual.c index 0dfd3082..9e267bea 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -1151,9 +1151,9 @@ static int context_update(struct context *ctx) RRCrtc rr_crtc; Status ret; - DBG(("%s: copying configuration from %s (mode=%ld: %s) to %s\n", + DBG(("%s: copying configuration from %s (mode=%ld: %dx%d) to %s\n", DisplayString(dst->dpy), - src->name, (long)src->mode.id, src->mode.name, + src->name, (long)src->mode.id, src->mode.width, src->mode.height, dst->name)); if (src->mode.id == 0) { @@ -1188,15 +1188,20 @@ err: /* XXX User names must be unique! */ m = src->mode; m.nameLength = snprintf(buf, sizeof(buf), - "%s.%ld-%s", src->name, (long)src->mode.id, src->mode.name); + "%s.%ld-%dx%d", src->name, + (long)src->mode.id, + src->mode.width, + src->mode.height); m.name = buf; id = XRRCreateMode(dst->dpy, dst->window, &m); if (id) { - DBG(("%s: adding mode %ld: %s to %s\n", + DBG(("%s: adding mode %ld: %dx%d to %s, new mode %ld\n", DisplayString(dst->dpy), - (long)id, src->mode.name, - dst->name)); + (long)src->mode.id, + src->mode.width, + src->mode.height, + dst->name (long)id,)); XRRAddOutputMode(dst->dpy, dst->rr_output, id); dst->mode.id = id; } else { |