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/jpeg.c | |
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/jpeg.c')
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index fca24a1baa9..4a937738b52 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -57,7 +57,7 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int fla static const uchar jpeg_default_quality = 75; static uchar ibuf_quality; -int imb_is_a_jpeg(const unsigned char *mem) +bool imb_is_a_jpeg(const unsigned char *mem, const size_t UNUSED(size)) { if ((mem[0] == 0xFF) && (mem[1] == 0xD8)) { return 1; @@ -429,7 +429,7 @@ ImBuf *imb_load_jpeg(const unsigned char *buffer, struct my_error_mgr jerr; ImBuf *ibuf; - if (!imb_is_a_jpeg(buffer)) { + if (!imb_is_a_jpeg(buffer, size)) { return NULL; } |