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);
          |                                                 ^~~~
master
Simon Ser 7 months ago committed by Simon Zeni
parent 29cb151987
commit 315e022f2f

@ -412,7 +412,7 @@ static struct wlr_drm_layer *get_or_create_layer(struct wlr_drm_backend *drm,
abort(); // unreachable abort(); // unreachable
#endif #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 (layer->candidate_planes == NULL) {
#if HAVE_LIBLIFTOFF #if HAVE_LIBLIFTOFF
liftoff_layer_destroy(layer->liftoff); liftoff_layer_destroy(layer->liftoff);

Loading…
Cancel
Save