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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-11 19:05:03 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-11 19:08:30 +0300
commit93633efe69ca4e610304b34268e523f54f9d7d57 (patch)
tree6b21e74f2aad9717e03755f8582e04d3787a1d07 /source/blender/blenloader/intern/readblenentry.c
parent1bc8ddbc6ce4c80919640aee9a29da63d8f6b442 (diff)
Fix (unreported) broken ID previews reading.
Recent changes to blendfile reading adding deferred reading of actual data broke it, we cannot use the nifty `bhead + 1` to access data anymore, since there is no guaranty that that block hass been fully read. Note that there is still one case in `read_file_thumbnail()`, however loading of blendfile preview itself seems to be working fine... Maybe @campbellbarton can double check that point (or knows of hands whether it is OK there)?
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 7fcacd8f30e..f59ed7eef48 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -204,7 +204,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
size_t len = new_prv->w[0] * new_prv->h[0] * sizeof(uint);
new_prv->rect[0] = MEM_callocN(len, __func__);
bhead = blo_bhead_next(fd, bhead);
- rect = (uint *)(bhead + 1);
+ rect = BLO_library_read_struct(fd, bhead, "PreviewImage Icon Rect");
BLI_assert(len == bhead->len);
memcpy(new_prv->rect[0], rect, len);
}
@@ -221,7 +221,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
size_t len = new_prv->w[1] * new_prv->h[1] * sizeof(uint);
new_prv->rect[1] = MEM_callocN(len, __func__);
bhead = blo_bhead_next(fd, bhead);
- rect = (uint *)(bhead + 1);
+ rect = BLO_library_read_struct(fd, bhead, "PreviewImage Image Rect");
BLI_assert(len == bhead->len);
memcpy(new_prv->rect[1], rect, len);
}