Skip to content

Commit 34750bf

Browse files
committed
lodepng.c (lodepng_encode): check for preProcessScanlines() errors.
(patch by 'yoch', from lvandeve/lodepng#66)
1 parent cf642bd commit 34750bf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

quakespasm/Quake/lodepng.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5677,10 +5677,16 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize,
56775677
{
56785678
state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h);
56795679
}
5680-
if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder);
5680+
if(!state->error)
5681+
{
5682+
state->error = preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder);
5683+
}
56815684
lodepng_free(converted);
56825685
}
5683-
else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder);
5686+
else
5687+
{
5688+
state->error = preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder);
5689+
}
56845690
}
56855691

56865692
/* output all PNG chunks */

0 commit comments

Comments
 (0)