Skip to content

Commit c2d0b59

Browse files
committed
kmsdrm: Fix double-free of GBM surface buffer in atomic mode
1 parent 57f3d2e commit c2d0b59

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/video/kmsdrm/SDL_kmsdrmvideo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,9 @@ static void KMSDRM_DestroySurfaces(SDL_VideoDevice *_this, SDL_Window *window)
17081708
/***************************/
17091709

17101710
if (windata->bo) {
1711-
KMSDRM_gbm_surface_release_buffer(windata->gs, windata->bo);
1711+
if (windata->bo != windata->next_bo) {
1712+
KMSDRM_gbm_surface_release_buffer(windata->gs, windata->bo);
1713+
}
17121714
windata->bo = NULL;
17131715
}
17141716

0 commit comments

Comments
 (0)