diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-01 16:25:07 +1100 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-01 16:25:07 +1100 |
| commit | 13f9b8ac3fbcd32302918f8ac6c54d3c95849818 (patch) | |
| tree | 70a19bfaa59d7c2f5ea2c8217a0bd526bd91f568 | |
| parent | e6611a0bb47c93fd26c5ef4d7a7c7d2bfd099bf7 (diff) | |
feat(png): Add require valid argument to ff_open_png
| -rw-r--r-- | include/tinyff/image/png.h | 2 | ||||
| -rw-r--r-- | src/format/image/png.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/tinyff/image/png.h b/include/tinyff/image/png.h index 000f186..05d5846 100644 --- a/include/tinyff/image/png.h +++ b/include/tinyff/image/png.h @@ -98,7 +98,7 @@ const ff_png_chunk_handler ff_png_chunk_handlers[] = { ff_result ff_png_isvalid(ff_stream *stream); -ff_result ff_open_png(ff_stream *stream, ff_png_ctx **out_ctx); +ff_result ff_open_png(ff_stream *stream, ff_png_ctx **out_ctx, ff_flag require_valid); ff_result ff_png_normalize(ff_png_ctx *ctx, ff_image_ctx **out_data); diff --git a/src/format/image/png.c b/src/format/image/png.c index a3c4176..fd9837b 100644 --- a/src/format/image/png.c +++ b/src/format/image/png.c @@ -32,9 +32,11 @@ ff_result ff_png_isvalid(ff_stream *stream) return FF_RESULT_OK; } -ff_result ff_open_png(ff_stream *stream, ff_png_ctx **out_ctx) +ff_result ff_open_png(ff_stream *stream, ff_png_ctx **out_ctx, ff_flag require_valid) { - + + (void)require_valid; // Just cast to void for now until I impl + ff_png_ctx *ctx = malloc(sizeof(ff_png_ctx)); if (!ctx) { ctx->last_error = FF_RESULT_ERROR_MEMORY_ALLOCATION; |
