diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-18 13:37:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-18 13:37:44 -0400 |
commit | 617be97fa0b9a0556c9a4ffda111365e65966b50 (patch) | |
tree | ceef74ac193c8100c5b6c364f2000700bd5164a3 /backend | |
parent | d748fd1a8e455685babdd79857c67351f03c6ff3 (diff) | |
parent | 0252c8e072818906549f88fcc28a68f97f503dc7 (diff) |
Merge pull request #108 from martinetd/realloc_crtcs_index
drm realloc_crtcs: check we found an output
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/drm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 6e831e41..65ea7f45 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -405,7 +405,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend, memset(possible_crtc, 0, sizeof(possible_crtc)); - size_t index = 0; + ssize_t index = -1; for (size_t i = 0; i < backend->outputs->length; ++i) { struct wlr_drm_output *o = backend->outputs->items[i]; if (o == output) { @@ -419,6 +419,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend, possible_crtc[i] = o->possible_crtc; crtc[o->crtc - backend->crtcs] = i; } + assert(index != -1); possible_crtc[index] = output->possible_crtc; match_obj(backend->outputs->length, possible_crtc, |