diff options
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 7d73b3050a6..9e9481566b0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -765,7 +765,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 { @@ -786,7 +788,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 { |