This patch adds a null check before accessing the return value of
ds_subsurface_from_surface().
The return value of ds_subsurface_from_surface() can be null even though
the ds_surface_is_subsurface() returns true. That's the case when the
subsurface has been destroyed.
Change-Id: I112dd4770b678f73e946be9773633083db8ce68b
ds_dbg("ds_surface(%p) commit", surface);
- if (ds_surface_is_subsurface(surface)) {
- subsurface = ds_subsurface_from_surface(surface);
+ subsurface = ds_subsurface_from_surface(surface);
+ if (subsurface) {
subsurface_commit(subsurface);
return;
}