diff --git a/src/display.cpp b/src/display.cpp index f57bda988a6..be4370c27f9 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -1397,9 +1397,11 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image, double alpha, Uin SDL_BlitSurface(tod_hex_mask2,NULL,dst,&dstrect); } } else if(mask != "") { - scoped_sdl_surface img(image::get_image(mask,image::UNMASKED,image::NO_ADJUST_COLOUR)); - SDL_Rect dstrect = { xpos, ypos, 0, 0 }; - SDL_BlitSurface(img,NULL,dst,&dstrect); + const scoped_sdl_surface img(image::get_image(mask,image::UNMASKED,image::NO_ADJUST_COLOUR)); + if(img != NULL) { + SDL_Rect dstrect = { xpos, ypos, 0, 0 }; + SDL_BlitSurface(img,NULL,dst,&dstrect); + } } if(grid_) { diff --git a/src/image.cpp b/src/image.cpp index 6c159981eda..fe6de81f27d 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -147,6 +147,7 @@ void set_zoom(double amount) clear_surfaces(scaledImages_); clear_surfaces(greyedImages_); clear_surfaces(brightenedImages_); + clear_surfaces(unmaskedImages_); } }