OBJ: fix import of files with really large polygons (e.g. 7000 vertices in one poly)

Bug report #110948: a file with a polygon so large that a single line
is 140 kilobytes. The previous limit was 64kb, increase the read file
chunk limit to 256kb. Still not fully robust, would need a more
complex fix to support arbitrarily large line length limits.
This commit is contained in:
Aras Pranckevicius
2023-08-09 17:04:24 +03:00
parent 63115218d8
commit 3bf2757b47
2 changed files with 2 additions and 2 deletions

View File

@@ -433,7 +433,7 @@ static void geom_new_object(const char *p,
r_curr_geom, GEOM_MESH, StringRef(p, end).trim(), r_all_geometries);
}
OBJParser::OBJParser(const OBJImportParams &import_params, size_t read_buffer_size = 64 * 1024)
OBJParser::OBJParser(const OBJImportParams &import_params, size_t read_buffer_size)
: import_params_(import_params), read_buffer_size_(read_buffer_size)
{
obj_file_ = BLI_fopen(import_params_.filepath, "rb");

View File

@@ -20,6 +20,6 @@ void importer_main(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
const OBJImportParams &import_params,
size_t read_buffer_size = 64 * 1024);
size_t read_buffer_size = 256 * 1024);
} // namespace blender::io::obj