From bdc4c79b4e06450bb2735dbfeaa3b8a347248308 Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Sat, 31 Mar 2012 21:34:40 +0200 Subject: [PATCH] Fix for segfault when doing 'coc "seyda neen"'. This is a fix for segfault: ==8683== Process terminating with default action of signal 11 (SIGSEGV) ==8683== Access not within mapped region at address 0x0 ==8683== at 0x59DFE4: MWRender::Animation::handleShapes(std::vector >*, Ogre::Entity*, Ogre::SkeletonInstance*) (animation.cpp:503) ==8683== by 0x5A4ECE: MWRender::Actors::update(float) (actors.cpp:134) ==8683== by 0x5937A9: MWRender::RenderingManager::update(float) (renderingmanager.cpp:168) ==8683== by 0x629AD6: MWWorld::World::update(float) (world.cpp:705) ==8683== by 0x68B022: OMW::Engine::frameRenderingQueued(Ogre::FrameEvent const&) (engine.cpp:157) ==8683== by 0x51F9574: Ogre::Root::_fireFrameRenderingQueued(Ogre::FrameEvent&) (in /usr/lib/libOgreMain.so.1.8.0) ==8683== by 0x51F964F: Ogre::Root::_fireFrameRenderingQueued() (in /usr/lib/libOgreMain.so.1.8.0) ==8683== by 0x51F9681: Ogre::Root::_updateAllRenderTargets() (in /usr/lib/libOgreMain.so.1.8.0) ==8683== by 0x51F98CF: Ogre::Root::renderOneFrame() (in /usr/lib/libOgreMain.so.1.8.0) ==8683== by 0x51F990C: Ogre::Root::startRendering() (in /usr/lib/libOgreMain.so.1.8.0) ==8683== by 0x68A669: OMW::Engine::go() (engine.cpp:408) ==8683== by 0x51CECB: main (main.cpp:254) ==8683== If you believe this happened as a result of a stack ==8683== overflow in your program's main thread (unlikely but ==8683== possible), you can try to increase the size of the ==8683== main thread stack using the --main-stacksize= flag. ==8683== The main thread stack size used in this run was 8388608. when doing 'coc "seyda neen"' when animations are enabled (Animation::animate member variable is set to 1). --- apps/openmw/mwrender/animation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index f3a8f64d5..fb710443b 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -126,6 +126,11 @@ namespace MWRender{ void Animation::handleShapes(std::vector* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel){ shapeNumber = 0; + if (allshapes == NULL || creaturemodel == NULL || skel == NULL) + { + return; + } + std::vector::iterator allshapesiter; for(allshapesiter = allshapes->begin(); allshapesiter != allshapes->end(); allshapesiter++)