gfx-source-texture: Check for valid child and parent

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-11-08 04:25:43 +01:00
parent 6d25342302
commit e4a5b34745
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,9 @@ std::shared_ptr<gs::texture> gfx::source_texture::render(size_t width, size_t he
if ((height == 0) || (height >= 16384)) { if ((height == 0) || (height >= 16384)) {
throw std::runtime_error("Height too large or too small."); throw std::runtime_error("Height too large or too small.");
} }
if (child->destroyed() || parent->destroyed()) {
return nullptr;
}
{ {
auto op = render_target->render((uint32_t)width, (uint32_t)height); auto op = render_target->render((uint32_t)width, (uint32_t)height);