From 2d60845786aeab099c61ffa42b7f72cccc68bff1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 Nov 2020 16:14:06 +1100 Subject: Cleanup: pass header size to 'is_a' callbacks No functional changes, prepare for fixing out-of-bounds access when reading headers. --- source/blender/imbuf/intern/iris.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/imbuf/intern/iris.c') diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 6bf2e3ec8d3..c27ac5754c7 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -243,7 +243,7 @@ static void test_endian_zbuf(struct ImBuf *ibuf) /* this one is only def-ed once, strangely... */ #define GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) -int imb_is_a_iris(const uchar *mem) +bool imb_is_a_iris(const uchar *mem, size_t UNUSED(size)) { return ((GS(mem) == IMAGIC) || (GSS(mem) == IMAGIC)); } @@ -271,7 +271,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors return NULL; } - if (!imb_is_a_iris(mem)) { + if (!imb_is_a_iris(mem, size)) { return NULL; } -- cgit v1.2.3