summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-03-28 16:29:40 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-03-28 16:30:38 +1100
commit0fc6e368cb93c098933633d358479a0b5a255549 (patch)
tree97a12c47c1b111d29f92956fae419f558be32f40
parent21e38c781e9d9b392d3e07371b49fae709c0fec3 (diff)
feat(bmp): Set ff_bmp_ctx file size to buffer location after the
signiture
-rw-r--r--Makefile1
-rw-r--r--include/tinyff/tinyff.h1
-rw-r--r--src/format/image/bmp.c5
3 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4b96fa7..9cebce2 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ $(OUTDIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
+
clean:
rm -rf $(OUTDIR)
diff --git a/include/tinyff/tinyff.h b/include/tinyff/tinyff.h
index 51298ef..52d3f03 100644
--- a/include/tinyff/tinyff.h
+++ b/include/tinyff/tinyff.h
@@ -4,6 +4,7 @@
#include "common.h"
#include "stream.h"
+
typedef struct {
// Debug settings
ff_stream* ff_debug_stream;
diff --git a/src/format/image/bmp.c b/src/format/image/bmp.c
index dde7d7e..2df3610 100644
--- a/src/format/image/bmp.c
+++ b/src/format/image/bmp.c
@@ -74,5 +74,10 @@ ff_result ff_bmp_header_handler(uint8_t *buf, size_t len, ff_bmp_ctx *ctx) {
return FF_RESULT_ERROR_INVALID_BMP_HEADER;
}
+ // We've already read the signiture so we just jump straight to
+ // the fileSize part
+
+ ctx->file_size = buf[4];
+
return FF_RESULT_WARN_NO_IMPL;
} \ No newline at end of file