summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2015-10-06 08:43:12 -0400
committerMichel Dänzer <michel.daenzer@amd.com>2015-10-07 16:59:36 +0900
commit56398d6651dfc4935cbd117ad861e1800077c73c (patch)
treedaa4c4e0e05a8c4f98c9d7d009157a8ad2835b05
parent4b92b960c7705be8b3a5dee17b2341864d7ca9bb (diff)
Avoid NULL dereference if drmmode_crtc_scanout_allocate fails
This avoids a NULL dereference if the memory allocation fails. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/drmmode_display.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index d75a629..a91d018 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -535,8 +535,11 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
drmmode_crtc_scanout_destroy(drmmode, scanout);
}
- if (!data)
+ if (!data) {
data = drmmode_crtc_scanout_allocate(crtc, scanout, width, height);
+ if (!data)
+ return NULL;
+ }
rotate_pitch = gbm_bo_get_stride(scanout->bo->bo.gbm);