From 545f6ca8b7f96e12ced9eacaac6af607e13a5d39 Mon Sep 17 00:00:00 2001 From: dasha_uwu Date: Fri, 13 Jun 2025 04:49:58 +0500 Subject: [PATCH] randr: fix BUG_RETURN_VAL check nvidia driver can call with numOutputs == 0 and outputs == NULL which is valid Signed-off-by: dasha_uwu --- randr/rrcrtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 29bd9b5fb..78c2baef8 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -190,7 +190,7 @@ RRCrtcNotify(RRCrtcPtr crtc, /* * Copy the new list of outputs into the crtc */ - BUG_RETURN_VAL(outputs == NULL, FALSE); + BUG_RETURN_VAL(numOutputs != 0 && outputs == NULL, FALSE); memcpy(crtc->outputs, outputs, numOutputs * sizeof(RROutputPtr)); /* @@ -754,7 +754,7 @@ RRCrtcSet(RRCrtcPtr crtc, Bool crtcChanged; int o; - BUG_RETURN_VAL(outputs == NULL, FALSE); + BUG_RETURN_VAL(numOutputs != 0 && outputs == NULL, FALSE); rrScrPriv(pScreen);