DumbFB: don't unmap if not mapped
[android/external-libkmsxx.git] / libkms++ / dumbframebuffer.cpp
index ec0fefb85f68eaad5f16e43b3ab0817d785bb6e8..cc97dde6a07356380b4b13731ed799054706ea64 100644 (file)
@@ -117,7 +117,8 @@ void DumbFramebuffer::Destroy()
                FramebufferPlane& plane = m_planes[i];
 
                /* unmap buffer */
-               munmap(plane.map, plane.size);
+               if (plane.map)
+                       munmap(plane.map, plane.size);
 
                /* delete dumb buffer */
                struct drm_mode_destroy_dumb dreq = drm_mode_destroy_dumb();