mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Simplified API: write-to-memory, overflow handling
This implements an API and provides a number of assist macros to allow an application which uses the simplified API write to bypass stdio and write directly to memory. It also includes some warnings (png.h) and some check code to detect *possible* overflow in the ROW_STRIDE and simplified image SIZE macros. This disallows image width/height/format that *might* overflow. A quiet API change that limits in-memory image size (uncompressed) to less that 4GByte and image row size (stride) to less than 2GByte. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
@@ -873,9 +873,12 @@ option SIMPLIFIED_READ_BGR enables FORMAT_BGR,
|
||||
|
||||
# Write:
|
||||
option SIMPLIFIED_WRITE,
|
||||
requires WRITE STDIO, SETJMP, WRITE_SWAP, WRITE_PACK,
|
||||
requires WRITE, SETJMP, WRITE_SWAP, WRITE_PACK,
|
||||
WRITE_tRNS, WRITE_gAMA, WRITE_sRGB, WRITE_cHRM
|
||||
|
||||
# 1.6.22: allow simplified write without stdio support:
|
||||
option SIMPLIFIED_WRITE_STDIO requires SIMPLIFIED_WRITE STDIO
|
||||
|
||||
option SIMPLIFIED_WRITE_AFIRST enables FORMAT_AFIRST,
|
||||
requires SIMPLIFIED_WRITE WRITE_SWAP_ALPHA
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
#define PNG_SIMPLIFIED_READ_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
|
||||
#define PNG_STDIO_SUPPORTED
|
||||
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
|
||||
|
||||
@@ -249,3 +249,4 @@ EXPORTS
|
||||
png_set_check_for_invalid_index @242
|
||||
png_get_palette_max @243
|
||||
png_set_option @244
|
||||
png_image_write_to_memory @245
|
||||
|
||||
Reference in New Issue
Block a user