diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-31 09:05:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-31 09:05:57 +0300 |
commit | b547ac32d94e988a5514dc1e79f2d7181a5385d5 (patch) | |
tree | a186960d5e6997ff154218960783d1f26e925059 /source/blender/imbuf/intern/iris.c | |
parent | e7f890aa59add3b0d83fd56c7423aa58cdd30f65 (diff) |
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.
Diffstat (limited to 'source/blender/imbuf/intern/iris.c')
-rw-r--r-- | source/blender/imbuf/intern/iris.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |