Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
lodepng.c (lodepng_encode): check for preProcessScanlines() errors.
Browse files Browse the repository at this point in the history
(patch by 'yoch', from lvandeve/lodepng#66)

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1553 af15c1b1-3010-417e-b628-4374ebc0bcbd
  • Loading branch information
sezero committed Jan 11, 2018
1 parent 425e538 commit 3d59b98
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions quakespasm/Quake/lodepng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3d59b98

Please sign in to comment.