1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-13 22:06:58 +02:00

Fixed CID 1197342

This commit is contained in:
AlexVinS 2016-12-05 03:17:03 +03:00
parent 7126bd61a4
commit 45ae1ef165

View File

@ -185,23 +185,24 @@ void CSDL_Ext::alphaTransform(SDL_Surface *src)
template<int bpp>
int CSDL_Ext::blit8bppAlphaTo24bppT(const SDL_Surface * src, const SDL_Rect * srcRect, SDL_Surface * dst, SDL_Rect * dstRect)
{
if (src && src->format->BytesPerPixel==1 && dst && (bpp==3 || bpp==4 || bpp==2)) //everything's ok
/* Make sure the surfaces aren't locked */
if ( ! src || ! dst )
{
SDL_SetError("SDL_UpperBlit: passed a nullptr surface");
return -1;
}
if ( src->locked || dst->locked )
{
SDL_SetError("Surfaces must not be locked during blit");
return -1;
}
if (src->format->BytesPerPixel==1 && (bpp==3 || bpp==4 || bpp==2)) //everything's ok
{
SDL_Rect fulldst;
int srcx, srcy, w, h;
/* Make sure the surfaces aren't locked */
if ( ! src || ! dst )
{
SDL_SetError("SDL_UpperBlit: passed a nullptr surface");
return -1;
}
if ( src->locked || dst->locked )
{
SDL_SetError("Surfaces must not be locked during blit");
return -1;
}
/* If the destination rectangle is nullptr, use the entire dest surface */
if ( dstRect == nullptr )
{