diff options
author | Bastien Montagne <bastien@blender.org> | 2021-06-24 11:53:45 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-06-24 13:10:06 +0300 |
commit | 8cdb99d51c02d5cc60c774c176a43519c046e14c (patch) | |
tree | 0185df926bf3c14905d51a648c1d155cccc4dce1 /source/blender/blenloader/intern/readblenentry.c | |
parent | 3a8347f82348ef2f430cdaa8a2e840ad3dba5a71 (diff) |
Fix linking code after own recent commit.
More stupid mistake in recent enhanced reports for file load code,
rB82c17082ba0e left some read-after-free situations.
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 1a324d56f06..44a26b9bf85 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -84,12 +84,13 @@ BlendHandle *BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport * \param memsize: The size of the data. * \return A handle on success, or NULL on failure. */ -BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize) +BlendHandle *BLO_blendhandle_from_memory(const void *mem, + int memsize, + BlendFileReadReport *reports) { BlendHandle *bh; - bh = (BlendHandle *)blo_filedata_from_memory( - mem, memsize, &(BlendFileReadReport){.reports = NULL}); + bh = (BlendHandle *)blo_filedata_from_memory(mem, memsize, reports); return bh; } @@ -398,8 +399,9 @@ BlendFileData *BLO_read_from_memory(const void *mem, { BlendFileData *bfd = NULL; FileData *fd; + BlendFileReadReport bf_reports = {.reports = reports}; - fd = blo_filedata_from_memory(mem, memsize, &(BlendFileReadReport){.reports = reports}); + fd = blo_filedata_from_memory(mem, memsize, &bf_reports); if (fd) { fd->skip_flags = skip_flags; bfd = blo_read_file_internal(fd, ""); @@ -426,8 +428,9 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, BlendFileData *bfd = NULL; FileData *fd; ListBase old_mainlist; + BlendFileReadReport bf_reports = {.reports = reports}; - fd = blo_filedata_from_memfile(memfile, params, &(BlendFileReadReport){.reports = reports}); + fd = blo_filedata_from_memfile(memfile, params, &bf_reports); if (fd) { fd->skip_flags = params->skip_flags; BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase)); |