diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:06 +0300 |
commit | 2d60845786aeab099c61ffa42b7f72cccc68bff1 (patch) | |
tree | aa3f17a33f029f9a8de69b081d219ee506e71f8e /source/blender/imbuf/intern/util.c | |
parent | 99f56b4c16323f96c0cbf54e392fb509fcac5bda (diff) |
Cleanup: pass header size to 'is_a' callbacks
No functional changes, prepare for fixing out-of-bounds access
when reading headers.
Diffstat (limited to 'source/blender/imbuf/intern/util.c')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 73d1cadaa69..1741d3f20b7 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -169,7 +169,7 @@ int IMB_ispic_type_from_memory(const unsigned char *mem, const size_t mem_size) for (const ImFileType *type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { if (type->is_a != NULL) { - if (type->is_a(buf)) { + if (type->is_a(buf, HEADER_SIZE)) { return type->filetype; } } @@ -200,7 +200,7 @@ bool IMB_ispic_type_matches(const char *filepath, int filetype) * Keep the check for developers. */ BLI_assert(type->is_a != NULL); if (type->is_a != NULL) { - return type->is_a(buf); + return type->is_a(buf, HEADER_SIZE); } } } |