diff options
| -rw-r--r-- | include/tinyff/result.h | 3 | ||||
| -rw-r--r-- | src/format/image/bmp.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/tinyff/result.h b/include/tinyff/result.h index 43bcf98..b2bf31c 100644 --- a/include/tinyff/result.h +++ b/include/tinyff/result.h @@ -27,6 +27,9 @@ typedef enum { // PNG FF_RESULT_ERROR_INVALID_PNG_SIGNATURE, + + // BMP + FF_RESULT_ERROR_INVALID_BMP_HEADER, // Archive (more general archives terms) FF_RESULT_ERROR_DECOMPRESSION_FAILURE, diff --git a/src/format/image/bmp.c b/src/format/image/bmp.c index e565b16..dde7d7e 100644 --- a/src/format/image/bmp.c +++ b/src/format/image/bmp.c @@ -69,7 +69,9 @@ ff_result ff_bmp_header_handler(uint8_t *buf, size_t len, ff_bmp_ctx *ctx) { (void) ctx; if (len != FF_BMP_HEADER_SIZE) { - + ff_dprintf("bmp: bitmap header is not correct size (expected 14, got %d)\n", len); + ctx->last_error = FF_RESULT_ERROR_INVALID_BMP_HEADER; + return FF_RESULT_ERROR_INVALID_BMP_HEADER; } return FF_RESULT_WARN_NO_IMPL; |
