mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Fix crash in Editor::drawOneSpriteUnclippedRect() if a temporary surface cannot be created (fix #413)
This commit is contained in:
parent
fa1d9de578
commit
80073e65d1
@ -412,9 +412,11 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& rc, in
|
||||
}
|
||||
|
||||
she::Surface* tmp(she::instance()->createRgbaSurface(width, height));
|
||||
convert_image_to_surface(rendered, m_sprite->getPalette(m_frame),
|
||||
tmp, 0, 0, 0, 0, width, height);
|
||||
g->blit(tmp, 0, 0, dest_x, dest_y, width, height);
|
||||
if (tmp->nativeHandle()) {
|
||||
convert_image_to_surface(rendered, m_sprite->getPalette(m_frame),
|
||||
tmp, 0, 0, 0, 0, width, height);
|
||||
g->blit(tmp, 0, 0, dest_x, dest_y, width, height);
|
||||
}
|
||||
tmp->dispose();
|
||||
}
|
||||
}
|
||||
|
@ -59,8 +59,10 @@ namespace she {
|
||||
}
|
||||
|
||||
~Alleg4Surface() {
|
||||
if (m_destroy & DestroyHandle)
|
||||
destroy_bitmap(m_bmp);
|
||||
if (m_destroy & DestroyHandle) {
|
||||
if (m_bmp)
|
||||
destroy_bitmap(m_bmp);
|
||||
}
|
||||
}
|
||||
|
||||
// Surface implementation
|
||||
|
Loading…
x
Reference in New Issue
Block a user