DIRECTOR: LINGO: Fix potential crash

This commit is contained in:
Eugene Sandulenko
2023-06-03 09:43:43 +02:00
parent da0e6444cb
commit ba047bd1cc
+3 -2
View File
@@ -2645,11 +2645,12 @@ void LB::b_spriteBox(int nargs) {
int spriteId = g_lingo->pop().asInt();
Channel *channel = g_director->getCurrentMovie()->getScore()->getChannelById(spriteId);
channel->_sprite->_stretch = true;
if (!channel)
return;
// This automatically sets the sctretch mode
channel->_sprite->_stretch = true;
g_director->getCurrentWindow()->addDirtyRect(channel->getBbox());
channel->setBbox(l, t, r, b);
channel->_dirty = true;