From 0ddbbdd5999cb6d03b5b60a453d56298cf588c6e Mon Sep 17 00:00:00 2001 From: sezero Date: Thu, 11 Jan 2018 07:00:02 +0000 Subject: [PATCH] lodepng.c (lodepng_encode): check for preProcessScanlines() errors. (patch by 'yoch', from https://github.com/lvandeve/lodepng/pull/66) git-svn-id: https://svn.code.sf.net/p/quakespasm/code/trunk@1553 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/lodepng.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Quake/lodepng.c b/Quake/lodepng.c index 9a8055cae..a03a0a1dd 100644 --- a/Quake/lodepng.c +++ b/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 */