diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 14:33:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 14:33:48 +0300 |
commit | e04ea9d3c31a63af28d2ea8ef418ad0b8db16bf7 (patch) | |
tree | 120542f27f47f2aed1d9c4e6f1e314fdd7a27970 /source/blender/blenloader/intern/readfile.c | |
parent | c51b017a1a12ed1bc9001c2e4e47b14e07f53b53 (diff) | |
parent | 53580265118236a096257b50f29d354243bdefe3 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 96e3f4704d9..672b61fa122 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -775,7 +775,9 @@ static BHeadN *get_bhead(FileData *fd) bh8_from_bh4(&bhead, &bhead4); } else { - memcpy(&bhead, &bhead4, sizeof(bhead)); + /* MIN2 is only to quiet '-Warray-bounds' compiler warning. */ + BLI_assert(sizeof(bhead) == sizeof(bhead4)); + memcpy(&bhead, &bhead4, MIN2(sizeof(bhead), sizeof(bhead4))); } } else { @@ -796,7 +798,9 @@ static BHeadN *get_bhead(FileData *fd) bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN)); } else { - memcpy(&bhead, &bhead8, sizeof(bhead)); + /* MIN2 is only to quiet '-Warray-bounds' compiler warning. */ + BLI_assert(sizeof(bhead) == sizeof(bhead8)); + memcpy(&bhead, &bhead8, MIN2(sizeof(bhead), sizeof(bhead8))); } } else { |