forked from enlightenment/efl
fix possible division by 0
This commit is contained in:
parent
4b443e752f
commit
0d13612a27
|
@ -116,6 +116,9 @@ save_image_qoi(RGBA_Image *im, const char *file, int quality EINA_UNUSED)
|
|||
for (px_pos = 0; px_pos < px_len; px_pos += channels, iter +=4)
|
||||
{
|
||||
px.rgba.a = *(iter + 3);
|
||||
if (px.rgba.a == 0)
|
||||
goto close_f;
|
||||
|
||||
px.rgba.b = *(iter + 0) * 255 / px.rgba.a;
|
||||
px.rgba.g = *(iter + 1) * 255 / px.rgba.a;
|
||||
px.rgba.r = *(iter + 2) * 255 / px.rgba.a;
|
||||
|
|
Loading…
Reference in New Issue