From 351219bfd8db0475519703f16d4ef0406da33cf8 Mon Sep 17 00:00:00 2001 From: Manuel Alfayate Corchete Date: Wed, 9 Sep 2020 03:18:26 +0200 Subject: [PATCH] kmsdrm: On VideoQuit(), only destroy dumb buffer if it exists. --- src/video/kmsdrm/SDL_kmsdrmvideo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index fba1d14c6..ae8d37b8e 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1447,9 +1447,11 @@ KMSDRM_VideoQuit(_THIS) SDL_SetError("Failed to issue atomic commit on DestroyWindow()."); } - /* Destroy the DUMB buffer, now that it's not being + /* Destroy the DUMB buffer if it exists, now that it's not being used anymore by the PRIMARY PLANE. */ - KMSDRM_DestroyDumbBuffer(_this, dispdata->dumb_buffer); + if (dispdata->dumb_buffer) { + KMSDRM_DestroyDumbBuffer(_this, dispdata->dumb_buffer); + } /***************/ /* BLOCK ENDS. */