diff options
Diffstat (limited to 'source/blender/imbuf/intern/oiio')
-rw-r--r-- | source/blender/imbuf/intern/oiio/openimageio_api.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp index 9f27ac96e6d..1e8c3c25778 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp +++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp @@ -163,9 +163,12 @@ static ImBuf *imb_oiio_load_image_float( extern "C" { -bool imb_is_a_photoshop(const unsigned char *mem, size_t UNUSED(size)) +bool imb_is_a_photoshop(const unsigned char *mem, size_t size) { const unsigned char magic[4] = {'8', 'B', 'P', 'S'}; + if (size < sizeof(magic)) { + return false; + } return memcmp(magic, mem, sizeof(magic)) == 0; } |