use a small static buffer for zero size surface

This commit is contained in:
Vincent Wei
2020-01-22 17:03:19 +08:00
parent fa7c84b2b5
commit b95538a415
+6
View File
@@ -160,6 +160,12 @@ GAL_Surface * GAL_CreateRGBSurface (Uint32 flags,
surface->flags &= ~GAL_HWSURFACE;
}
}
else {
/* set a static buff to pixels for empty surface */
static char buff[8];
surface->flags |= GAL_PREALLOC;
surface->pixels = buff;
}
/* Allocate an empty mapping */
surface->map = GAL_AllocBlitMap();