summaryrefslogtreecommitdiff
path: root/src/format/image
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 12:41:43 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 12:41:43 +1100
commit6e6620617067b919cef9df08b1e318b129779a8a (patch)
tree4130bab8ed612326dbc7f364f70fe98b85af2cbf /src/format/image
parent6d4fa967cbfb0d743a4123ab0fe177d10bf137d1 (diff)
fix(png): Remove last_error field (ff_png_ctx) additions from
png_isvalid function
Diffstat (limited to 'src/format/image')
-rw-r--r--src/format/image/png.c11
1 files changed, 3 insertions, 8 deletions
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);