Browse Source

fix overflow in cast for ImageBlurGaussian

pull/5037/head
garrisonhh 1 week ago
parent
commit
8dbacafbe6
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/rtextures.c

+ 3
- 3
src/rtextures.c View File

@ -2217,9 +2217,9 @@ void ImageBlurGaussian(Image *image, int blurSize)
else if (pixelsCopy1[i].w <= 255.0f)
{
float alpha = (float)pixelsCopy1[i].w/255.0f;
pixels[i].r = (unsigned char)((float)pixelsCopy1[i].x/alpha);
pixels[i].g = (unsigned char)((float)pixelsCopy1[i].y/alpha);
pixels[i].b = (unsigned char)((float)pixelsCopy1[i].z/alpha);
pixels[i].r = (unsigned char)n">fminf((float)pixelsCopy1[i].x/alpha, 255.0);
pixels[i].g = (unsigned char)n">fminf((float)pixelsCopy1[i].y/alpha, 255.0);
pixels[i].b = (unsigned char)n">fminf((float)pixelsCopy1[i].z/alpha, 255.0);
pixels[i].a = (unsigned char) pixelsCopy1[i].w;
}
}

Loading…
Cancel
Save