mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
translate image after error checking
This commit is contained in:
parent
a34a846ce7
commit
d61a8eb6e0
10
src/v_fmt.c
10
src/v_fmt.c
@ -576,11 +576,6 @@ void *V_CacheFlatNum(int lump, pu_tag tag)
|
|||||||
image = malloc(image_size);
|
image = malloc(image_size);
|
||||||
ret = spng_decode_image(ctx, image, image_size, SPNG_FMT_PNG, 0);
|
ret = spng_decode_image(ctx, image, image_size, SPNG_FMT_PNG, 0);
|
||||||
|
|
||||||
for (int i = 0; i < image_size; ++i)
|
|
||||||
{
|
|
||||||
image[i] = translate[image[i]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
I_Printf(VB_ERROR, "V_CacheFlatNum: spng_decode_image %s",
|
I_Printf(VB_ERROR, "V_CacheFlatNum: spng_decode_image %s",
|
||||||
@ -588,6 +583,11 @@ void *V_CacheFlatNum(int lump, pu_tag tag)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < image_size; ++i)
|
||||||
|
{
|
||||||
|
image[i] = translate[image[i]];
|
||||||
|
}
|
||||||
|
|
||||||
spng_ctx_free(ctx);
|
spng_ctx_free(ctx);
|
||||||
Z_Free(buffer);
|
Z_Free(buffer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user