Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index cf2181c8a27..9465819a2d8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -766,7 +766,7 @@ static void switch_endian_bh8(BHead8 *bhead)
}
}
-static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, int do_endian_swap)
+static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, bool do_endian_swap)
{
BHead4 *bhead4 = (BHead4 *)bhead;
int64_t old;
@@ -859,7 +859,7 @@ static BHeadN *get_bhead(FileData *fd)
}
if (fd->flags & FD_FLAGS_POINTSIZE_DIFFERS) {
- bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN));
+ bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN) != 0);
}
else {
/* MIN2 is only to quiet '-Warray-bounds' compiler warning. */
@@ -2509,6 +2509,32 @@ static void direct_link_ipo(BlendDataReader *reader, Ipo *ipo)
BLO_read_data_address(reader, &icu->bezt);
BLO_read_data_address(reader, &icu->bp);
BLO_read_data_address(reader, &icu->driver);
+
+ /* Undo generic endian switching. */
+ if (BLO_read_requires_endian_switch(reader)) {
+ BLI_endian_switch_int16(&icu->blocktype);
+ if (icu->driver != NULL) {
+
+ /* Undo generic endian switching. */
+ if (BLO_read_requires_endian_switch(reader)) {
+ BLI_endian_switch_int16(&icu->blocktype);
+ if (icu->driver != NULL) {
+ BLI_endian_switch_int16(&icu->driver->blocktype);
+ }
+ }
+ }
+
+ /* Undo generic endian switching. */
+ if (BLO_read_requires_endian_switch(reader)) {
+ BLI_endian_switch_int16(&ipo->blocktype);
+ BLI_endian_switch_int16(&icu->driver->blocktype);
+ }
+ }
+ }
+
+ /* Undo generic endian switching. */
+ if (BLO_read_requires_endian_switch(reader)) {
+ BLI_endian_switch_int16(&ipo->blocktype);
}
}