From 6e6620617067b919cef9df08b1e318b129779a8a Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Sun, 22 Feb 2026 12:41:43 +1100 Subject: fix(png): Remove last_error field (ff_png_ctx) additions from png_isvalid function --- src/format/image/png.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/format') diff --git a/src/format/image/png.c b/src/format/image/png.c index 5500c34..7b203f5 100644 --- a/src/format/image/png.c +++ b/src/format/image/png.c @@ -4,12 +4,10 @@ ff_result ff_png_isvalid(ff_stream *stream) { ff_dprintf("png: validating signature\n"); - + char raw_sig[8]; if (stream->read(raw_sig, 8, stream->user) != 8) { ff_dprintf("png: failed to read signature bytes\n"); - - ctx->last_error = FF_RESULT_ERROR_INVALID_FILE; return FF_RESULT_ERROR_INVALID_FILE; } @@ -21,14 +19,11 @@ ff_result ff_png_isvalid(ff_stream *stream) if (memcmp(raw_sig, PNG_SIGNATURE, 8) != 0) { ff_dprintf("png: signature mismatch\n"); - - ctx->last_error = FF_RESULT_ERROR_INVALID_PNG_SIGNITURE; - return FF_RESULT_ERROR_INVALID_PNG_SIGNITURE; + return FF_RESULT_ERROR_INVALID_PNG_SIGNATURE; } ff_dprintf("png: signature valid\n"); - ctx->last_error = FF_RESULT_OK; return FF_RESULT_OK; } @@ -186,7 +181,7 @@ ff_result ff_png_data_handler(uint8_t *buf, size_t len, ff_png_ctx *ctx) return FF_RESULT_ERROR_MEMORY_ALLOCATION; } - if (tinf_uncompress(uncompressed_data, uncompressed_size, buf, len) != TINF_OK) { + if (tinf_uncompress(uncompressed_data, (unsigned int *)uncompressed_size, buf, len) != TINF_OK) { ff_dprintf("png: failed to uncompress IDAT data\n"); free(uncompressed_data); -- cgit v1.2.3