From b547ac32d94e988a5514dc1e79f2d7181a5385d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 31 Mar 2021 17:05:57 +1100 Subject: Cleanup: use early return for imbuf image loader functions Most imbuf loaders already did this, use early exit for the remaining loaders that didn't. --- source/blender/imbuf/intern/iris.c | 6 ++++-- 1 file changed, 4 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 112b95bf1a1..547af472d73 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -270,11 +270,13 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors ImBuf *ibuf = NULL; uchar dirty_flag = 0; - if (size < HEADER_SIZE) { + if (!imb_is_a_iris(mem, size)) { return NULL; } - if (!imb_is_a_iris(mem, size)) { + /* Could pe part of the magic check above, + * by convention this check only requests the size needed to read it's magic though. */ + if (size < HEADER_SIZE) { return NULL; } -- cgit v1.2.3