lodepng.c (lodepng_encode): check for preProcessScanlines() errors.

(patch by 'yoch', from https://github.com/lvandeve/lodepng/pull/66)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1553 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2018-01-11 07:00:02 +00:00
parent ae38737ada
commit 77a45cbbbe

View file

@ -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 */