diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-13 00:23:37 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-13 00:23:37 +0200 |
commit | 6904c836b203acbe87a85446a0c59bfbed359240 (patch) | |
tree | 61f5557f5bafff9b46c78b2152a953a3991d8565 /avmedia | |
parent | 573ced4087f46788a8596fb89c657d3427be4bf8 (diff) |
glTF: Avoid segmentation fault when one of the input files can't be loaded
libgltf: Parser releases the glTFHandle, but it was not connected to
the corresponding handle by RenderScene::initScene. So when rendering
stopped during file loading because of missing file, Parser's handle
member was an uninitialized pointer so it crashed by calling release
method.
Change-Id: I80099195341766f474143014d5949703d47a6fd8
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/opengl/oglplayer.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 35d99a408476..35ae14008ab1 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -36,7 +36,7 @@ OGLPlayer::~OGLPlayer() osl::MutexGuard aGuard(m_aMutex); if( m_pHandle ) { - for (size_t i = 0; i < m_pHandle->size; ++i) + for (size_t i = 0; i < m_pHandle->size && m_pHandle->files[i].buffer; ++i) { if (m_pHandle->files[i].type != GLTF_JSON) { |