GRAPHICS: Add error-checking in blendPixelPtr for invalid BPPs
This commit is contained in:
parent
0f59009e6e
commit
1d40dca7a0
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue