From 5ea1049e7520c0f369d2a76811410b1274699e81 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 20 Sep 2020 18:41:50 +0200 Subject: Sanitize type 'size' parameters in our read/write file code This patch tries to sanitize the types of our size parameters across our read and write code, which is currently fairly inconsistent (using `int`, `uint`, `size_t`...), by using `size_t` everywhere. Since in Blender file themselves we can only store chunk of size `MAX_INT`, added some asserts to ensure that as well. See {T79561} for details. Differential Revision: https://developer.blender.org/D8672 --- source/blender/blenloader/intern/undofile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/undofile.c') diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index 8ee539014f0..4da73138c38 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -154,7 +154,7 @@ void BLO_memfile_write_finalize(MemFileWriteData *mem_data) } } -void BLO_memfile_chunk_add(MemFileWriteData *mem_data, const char *buf, uint size) +void BLO_memfile_chunk_add(MemFileWriteData *mem_data, const char *buf, size_t size) { MemFile *memfile = mem_data->written_memfile; MemFileChunk **compchunk_step = &mem_data->reference_current_chunk; -- cgit v1.2.3