diff --git a/quakespasm/Quake/lodepng.c b/quakespasm/Quake/lodepng.c index 9a8055cae..a03a0a1dd 100644 --- a/quakespasm/Quake/lodepng.c +++ b/quakespasm/Quake/lodepng.c @@ -5677,10 +5677,16 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize, { state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); } - if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + if(!state->error) + { + state->error = preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + } lodepng_free(converted); } - else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + else + { + state->error = preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + } } /* output all PNG chunks */