Permalink
Browse files

sprite: set freePixxels in base only if not null

  • Loading branch information...
1 parent a911d39 commit bfb2d2c59b64d643b4e1043be034b4b43b1bb09c @bradallred bradallred committed Jul 5, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 gemrb/core/Sprite2D.cpp
@@ -31,7 +31,7 @@ const TypeID Sprite2D::ID = { "Sprite2D" };
Sprite2D::Sprite2D(int Width, int Height, int Bpp, const void* pixels)
: Width(Width), Height(Height), Bpp(Bpp), pixels(pixels)
{
- freePixels = true;
+ freePixels = (bool)(pixels);
BAM = false;
RLE = false;
XPos = 0;
@@ -59,7 +59,7 @@ Sprite2D::Sprite2D(const Sprite2D &obj)
Sprite2D::~Sprite2D()
{
- if (freePixels && pixels) {
+ if (freePixels) {
// FIXME: casting away const.
free((void*)pixels);
}

0 comments on commit bfb2d2c

Please sign in to comment.