diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:09 +0300 |
commit | 15ffda3bcd697e6f3a0cc13e141da865f36f3b53 (patch) | |
tree | f98d9fc831f18a9194818f5428466884654e802b /source/blender/imbuf/intern/cineon/cineon_dpx.c | |
parent | 2d60845786aeab099c61ffa42b7f72cccc68bff1 (diff) |
Fix T82602: checking image header reads past buffer bounds
Use the size argument to ensure checking the header doesn't read
past the buffer bounds when reading corrupt/truncated headers
from image files.
Diffstat (limited to 'source/blender/imbuf/intern/cineon/cineon_dpx.c')
-rw-r--r-- | source/blender/imbuf/intern/cineon/cineon_dpx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index 8bbd9fbb285..de54e6dab9d 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -188,9 +188,9 @@ bool imb_save_cineon(struct ImBuf *buf, const char *filepath, int flags) return imb_save_dpx_cineon(buf, filepath, 1, flags); } -bool imb_is_a_cineon(const unsigned char *buf, size_t UNUSED(size)) +bool imb_is_a_cineon(const unsigned char *buf, size_t size) { - return logImageIsCineon(buf); + return logImageIsCineon(buf, size); } ImBuf *imb_load_cineon(const unsigned char *mem, @@ -209,9 +209,9 @@ bool imb_save_dpx(struct ImBuf *buf, const char *filepath, int flags) return imb_save_dpx_cineon(buf, filepath, 0, flags); } -bool imb_is_a_dpx(const unsigned char *buf, size_t UNUSED(size)) +bool imb_is_a_dpx(const unsigned char *buf, size_t size) { - return logImageIsDpx(buf); + return logImageIsDpx(buf, size); } ImBuf *imb_load_dpx(const unsigned char *mem, |