mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 03:45:58 +01:00
drm realloc_crtcs: check we found an output
This follows-up on #105 that just initialized to 0. Instead, make sure we actually found an output that matches
This commit is contained in:
parent
995ebe3bb0
commit
0252c8e072
1 changed files with 2 additions and 1 deletions
|
@ -405,7 +405,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend,
|
||||||
|
|
||||||
memset(possible_crtc, 0, sizeof(possible_crtc));
|
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) {
|
for (size_t i = 0; i < backend->outputs->length; ++i) {
|
||||||
struct wlr_drm_output *o = backend->outputs->items[i];
|
struct wlr_drm_output *o = backend->outputs->items[i];
|
||||||
if (o == output) {
|
if (o == output) {
|
||||||
|
@ -419,6 +419,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend,
|
||||||
possible_crtc[i] = o->possible_crtc;
|
possible_crtc[i] = o->possible_crtc;
|
||||||
crtc[o->crtc - backend->crtcs] = i;
|
crtc[o->crtc - backend->crtcs] = i;
|
||||||
}
|
}
|
||||||
|
assert(index != -1);
|
||||||
|
|
||||||
possible_crtc[index] = output->possible_crtc;
|
possible_crtc[index] = output->possible_crtc;
|
||||||
match_obj(backend->outputs->length, possible_crtc,
|
match_obj(backend->outputs->length, possible_crtc,
|
||||||
|
|
Loading…
Reference in a new issue