return true;
}
- if (ext->width <= 0 || ext->height <= 0)
+ if (ext->width <= 0 || ext->height <= 0 || !d3d->d3ddev) {
return false;
+ }
ov = xcalloc(d3d9overlay, 1);
+ if (!ov) {
+ return false;
+ }
s = createtext(d3d, ext->width, ext->height, D3DFMT_A8R8G8B8);
if (!s) {
xfree(ov);
return true;
}
- if (ext->width <= 0 || ext->height <= 0)
+ if (ext->width <= 0 || ext->height <= 0 || !d3d->m_device) {
return false;
+ }
ov = xcalloc(d3doverlay, 1);
+ if (!ov) {
+ return false;
+ }
s = &ov->s;
if (!allocsprite(d3d, s, ext->width, ext->height, true, false, false)) {
return true;
}
- if (ext->width <= 0 || ext->height <= 0 || !ext->data)
+ if (ext->width <= 0 || ext->height <= 0 || !ext->data || !gdi->hdc) {
return false;
+ }
ov = xcalloc(gdioverlay, 1);
if (!ov) {