GRAPHICS: Add error-checking in blendPixelPtr for invalid BPPs

This commit is contained in:
Narek Mailian 2013-08-01 17:30:11 +02:00
parent 0f59009e6e
commit 1d40dca7a0

View file

@ -566,7 +566,7 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) {
| ((dG << _format.gShift) & _greenMask)
| ((dB << _format.bShift) & _blueMask)
| (*ptr & _alphaMask);
} else {
} else if (sizeof(PixelType) == 2) {
int idst = *ptr;
int isrc = color;
@ -581,6 +581,8 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) {
((int)(((int)(isrc & _blueMask) -
(int)(idst & _blueMask)) * alpha) >> 8))) |
(idst & _alphaMask));
} else {
error("Unsupported BPP format: %d", sizeof(PixelType));
}
}