Prevent division-by-zero crashes

This commit is contained in:
Fabian Keil 2014-12-02 15:08:04 +01:00 committed by Carsten Haitzler (Rasterman)
parent 540df42aab
commit c21beaf178
1 changed files with 5 additions and 5 deletions

View File

@ -229,7 +229,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
}
}
iptr = idata;
if (v == 255)
if (v == 0 || v == 255)
{
for (x = 0; x < w; x++)
{
@ -303,7 +303,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
}
}
iptr = idata;
if (v == 255)
if (v == 0 || v == 255)
{
for (x = 0; x < w; x++)
{
@ -376,7 +376,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
break;
ptr = data;
if (v == 255)
if (v == 0 || v == 255)
{
for (x = 0; x < w; x++)
{
@ -418,7 +418,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
break;
ptr = data;
if (v == 255)
if (v == 0 || v == 255)
{
for (x = 0; x < w; x++)
{
@ -493,7 +493,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
break;
ptr = data;
if (v == 255)
if (v == 0 || v == 255)
{
for (x = 0; x < w; x++)
{