Fix nullpointer deref
This commit is contained in:
parent
4f08382c69
commit
a9454fdf9c
|
@ -645,6 +645,9 @@ SDL_Surface *Bitmap::megaSurface()
|
|||
|
||||
void Bitmap::ensureNonMega()
|
||||
{
|
||||
if (isDisposed())
|
||||
return;
|
||||
|
||||
GUARD_MEGA;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ void Plane::setBitmap(Bitmap *value)
|
|||
{
|
||||
GUARD_DISPOSED;
|
||||
|
||||
value->ensureNonMega();
|
||||
if (value)
|
||||
value->ensureNonMega();
|
||||
|
||||
p->bitmap = value;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,8 @@ void Sprite::setBitmap(Bitmap *bitmap)
|
|||
if (p->bitmap == bitmap)
|
||||
return;
|
||||
|
||||
bitmap->ensureNonMega();
|
||||
if (bitmap)
|
||||
bitmap->ensureNonMega();
|
||||
|
||||
p->bitmap = bitmap;
|
||||
*p->srcRect = bitmap->rect();
|
||||
|
|
|
@ -715,7 +715,8 @@ void Window::setWindowskin(Bitmap *value)
|
|||
{
|
||||
GUARD_DISPOSED;
|
||||
|
||||
value->ensureNonMega();
|
||||
if (value)
|
||||
value->ensureNonMega();
|
||||
|
||||
p->windowskin = value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue