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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2016-10-29 17:22:33 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2016-10-29 17:22:33 +0300
commitd3b0977a354d91c363d7128f3e0ef2c5eea977e7 (patch)
tree0d42ca6fd9ba39a65551a06562f70d7508466833 /source/blender/alembic
parent753edafcb77d9aaf07fe869372319b841dd80681 (diff)
Fix T49878: Alembic crash with long object name
Crash comes from writing to char array (ID::name) out its bound and thus overriding memory in the ID struct.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_camera.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/alembic/intern/abc_camera.cc b/source/blender/alembic/intern/abc_camera.cc
index 5c34ec1391f..d5271e3ca31 100644
--- a/source/blender/alembic/intern/abc_camera.cc
+++ b/source/blender/alembic/intern/abc_camera.cc
@@ -119,7 +119,7 @@ bool AbcCameraReader::valid() const
void AbcCameraReader::readObjectData(Main *bmain, float time)
{
- Camera *bcam = static_cast<Camera *>(BKE_camera_add(bmain, "abc_camera"));
+ Camera *bcam = static_cast<Camera *>(BKE_camera_add(bmain, m_data_name.c_str()));
ISampleSelector sample_sel(time);
CameraSample cam_sample;
@@ -155,8 +155,6 @@ void AbcCameraReader::readObjectData(Main *bmain, float time)
bcam->gpu_dof.focus_distance = cam_sample.getFocusDistance();
bcam->gpu_dof.fstop = cam_sample.getFStop();
- BLI_strncpy(bcam->id.name + 2, m_data_name.c_str(), m_data_name.size() + 1);
-
m_object = BKE_object_add_only_object(bmain, OB_CAMERA, m_object_name.c_str());
m_object->data = bcam;
}