Skip to content

Commit

Permalink
KMSDRM: valid file descriptors could positive or 0. -1 is invalid. (B…
Browse files Browse the repository at this point in the history
…ug 4530)
  • Loading branch information
1bsyl committed Mar 13, 2019
1 parent 3bc1a8b commit cbe80d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -250,7 +250,7 @@ KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
{
KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)data;

if (fb_info && fb_info->drm_fd > 0 && fb_info->fb_id != 0) {
if (fb_info && fb_info->drm_fd >= 0 && fb_info->fb_id != 0) {
KMSDRM_drmModeRmFB(fb_info->drm_fd, fb_info->fb_id);
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Delete DRM FB %u", fb_info->fb_id);
}
Expand Down Expand Up @@ -552,7 +552,7 @@ KMSDRM_VideoQuit(_THIS)
}

if(vdata->saved_crtc != NULL) {
if(vdata->drm_fd > 0 && vdata->saved_conn_id > 0) {
if(vdata->drm_fd >= 0 && vdata->saved_conn_id > 0) {
/* Restore saved CRTC settings */
drmModeCrtc *crtc = vdata->saved_crtc;
if(KMSDRM_drmModeSetCrtc(vdata->drm_fd, crtc->crtc_id, crtc->buffer_id,
Expand Down

0 comments on commit cbe80d4

Please sign in to comment.