backend/drm: fix swapped calloc() arguments in get_or_create_layer()

../backend/drm/drm.c:415:49: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      415 |         layer->candidate_planes = calloc(sizeof(bool), drm->num_planes);
          |                                                 ^~~~
This commit is contained in:
Simon Ser 2024-05-10 09:38:20 +02:00 committed by Simon Zeni
parent 29cb151987
commit 315e022f2f

View File

@ -412,7 +412,7 @@ static struct wlr_drm_layer *get_or_create_layer(struct wlr_drm_backend *drm,
abort(); // unreachable
#endif
layer->candidate_planes = calloc(sizeof(bool), drm->num_planes);
layer->candidate_planes = calloc(drm->num_planes, sizeof(layer->candidate_planes[0]));
if (layer->candidate_planes == NULL) {
#if HAVE_LIBLIFTOFF
liftoff_layer_destroy(layer->liftoff);