diff options
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r-- | lib/igt_fb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 6fecdd66..35a928b9 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -1623,9 +1623,13 @@ void igt_put_cairo_ctx(int fd, struct igt_fb *fb, cairo_t *cr) */ void igt_remove_fb(int fd, struct igt_fb *fb) { + if (!fb || !fb->fb_id) + return; + cairo_surface_destroy(fb->cairo_surface); do_or_die(drmModeRmFB(fd, fb->fb_id)); gem_close(fd, fb->gem_handle); + fb->fb_id = 0; } /** |