mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-03-03 07:11:28 +00:00
Fixed fuzz drawer crash
This commit is contained in:
parent
3b6d177787
commit
4fd127651d
1 changed files with 13 additions and 4 deletions
|
@ -826,7 +826,10 @@ public:
|
||||||
// Handle the case where we would go out of bounds at the top:
|
// Handle the case where we would go out of bounds at the top:
|
||||||
if (yl < fuzzstep)
|
if (yl < fuzzstep)
|
||||||
{
|
{
|
||||||
uint32_t bg = dest[fuzzoffset[fuzz] * fuzzstep + pitch];
|
uint32_t *srcdest = dest + fuzzoffset[fuzz] * fuzzstep + pitch;
|
||||||
|
//assert(static_cast<int>((srcdest - (uint32_t*)dc_destorg) / (_pitch)) < viewheight);
|
||||||
|
|
||||||
|
uint32_t bg = *srcdest;
|
||||||
|
|
||||||
uint32_t red = RPART(bg) * 3 / 4;
|
uint32_t red = RPART(bg) * 3 / 4;
|
||||||
uint32_t green = GPART(bg) * 3 / 4;
|
uint32_t green = GPART(bg) * 3 / 4;
|
||||||
|
@ -842,7 +845,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lowerbounds = (yl + count * fuzzstep > _fuzzviewheight);
|
bool lowerbounds = (yl + (count + fuzzstep - 1) * fuzzstep > _fuzzviewheight);
|
||||||
if (lowerbounds)
|
if (lowerbounds)
|
||||||
count--;
|
count--;
|
||||||
|
|
||||||
|
@ -858,7 +861,10 @@ public:
|
||||||
count -= cnt;
|
count -= cnt;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint32_t bg = dest[fuzzoffset[fuzz] * fuzzstep];
|
uint32_t *srcdest = dest + fuzzoffset[fuzz] * fuzzstep;
|
||||||
|
//assert(static_cast<int>((srcdest - (uint32_t*)dc_destorg) / (_pitch)) < viewheight);
|
||||||
|
|
||||||
|
uint32_t bg = *srcdest;
|
||||||
|
|
||||||
uint32_t red = RPART(bg) * 3 / 4;
|
uint32_t red = RPART(bg) * 3 / 4;
|
||||||
uint32_t green = GPART(bg) * 3 / 4;
|
uint32_t green = GPART(bg) * 3 / 4;
|
||||||
|
@ -875,7 +881,10 @@ public:
|
||||||
// Handle the case where we would go out of bounds at the bottom
|
// Handle the case where we would go out of bounds at the bottom
|
||||||
if (lowerbounds)
|
if (lowerbounds)
|
||||||
{
|
{
|
||||||
uint32_t bg = dest[fuzzoffset[fuzz] * fuzzstep - pitch];
|
uint32_t *srcdest = dest + fuzzoffset[fuzz] * fuzzstep - pitch;
|
||||||
|
//assert(static_cast<int>((srcdest - (uint32_t*)dc_destorg) / (_pitch)) < viewheight);
|
||||||
|
|
||||||
|
uint32_t bg = *srcdest;
|
||||||
|
|
||||||
uint32_t red = RPART(bg) * 3 / 4;
|
uint32_t red = RPART(bg) * 3 / 4;
|
||||||
uint32_t green = GPART(bg) * 3 / 4;
|
uint32_t green = GPART(bg) * 3 / 4;
|
||||||
|
|
Loading…
Reference in a new issue