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/oiio | |
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/oiio')
-rw-r--r-- | source/blender/imbuf/intern/oiio/openimageio_api.cpp | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/oiio/openimageio_api.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp index 0b787a7842f..9f27ac96e6d 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp +++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp @@ -163,7 +163,7 @@ static ImBuf *imb_oiio_load_image_float( extern "C" { -int imb_is_a_photoshop(const unsigned char *mem) +bool imb_is_a_photoshop(const unsigned char *mem, size_t UNUSED(size)) { const unsigned char magic[4] = {'8', 'B', 'P', 'S'}; return memcmp(magic, mem, sizeof(magic)) == 0; diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.h b/source/blender/imbuf/intern/oiio/openimageio_api.h index 0ac6e560cfa..659050cdb00 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.h +++ b/source/blender/imbuf/intern/oiio/openimageio_api.h @@ -31,7 +31,7 @@ extern "C" { struct ImBuf; -int imb_is_a_photoshop(const unsigned char *mem); +bool imb_is_a_photoshop(const unsigned char *mem, const size_t size); int imb_save_photoshop(struct ImBuf *ibuf, const char *name, int flags); |