GNOME Bugzilla – Bug 751770
qtquick2videosink: Crash (sometimes) in VideoMaterialShader::updateState
Last modified: 2018-05-04 12:10:46 UTC
Created attachment 306470 [details] [review] Patch preventing the use of uninitialized textures for RGB formats in videomaterial.cpp Sometimes when my application starts, a crash appears. This is happening quite frequently if a QML animation is running at the same time. The crash occurs in : VideoMaterialShader::updateState() |_ VideoMaterial::bind() |_ VideoMaterial::bindTexture(int i, const quint8 *data) I saw that there is one texture used when using RGB format and 3 with the Yuv420P. In the first case, we use only the first row of the arrays m_textureWidths[], m_textureHeigth[], m_textureOffsets[] even if the size is 3. To know how many row we are using, there is a counter : m_textureCount. But in VideoMaterial::bind(), we are using the three row of these arrays, even in with the RGB format. In this case, the first row of these arrays is initialized but not the two others. The attached patch correct my crashes.
commit 49a030719452f44042d008b2018af246d120fb07 Author: Vincent Dehors <vincent.dehors@openwide.fr> Date: Fri May 4 15:08:47 2018 +0300 videomaterial.cpp: Prevent the use of uninitialized textures for RGB formats https://bugzilla.gnome.org/show_bug.cgi?id=751770