Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
Some future release
-
None
Description
Ran across usage of uninitialized values in distance field glyph cache using Valgrind memcheck connected to gdb which stopped here with an error:
16 QOpenGLFunctions::glCopyTexSubImage2D qopenglfunctions.h 701 0x85ad63f 17 QSGDefaultDistanceFieldGlyphCache::resizeTexture qsgdefaultdistancefieldglyphcache.cpp 484 0x85ad63f 18 QSGDefaultDistanceFieldGlyphCache::storeGlyphs qsgdefaultdistancefieldglyphcache.cpp 193 0x85adb2e 19 QSGDistanceFieldGlyphCache::update qsgadaptationlayer.cpp 197 0x8599335 20 QSGDistanceFieldGlyphNode::preprocess qsgdistancefieldglyphnode.cpp 158 0x85b2f5d 21 QSGRenderer::preprocess qsgrenderer.cpp 312 0x8578680 22 QSGRenderer::renderScene qsgrenderer.cpp 221 0x8577f43 23 QSGRenderer::renderScene qsgrenderer.cpp 197 0x857844b 24 QSGDefaultRenderContext::renderNextFrame qsgdefaultrendercontext.cpp 182 0x85b6a0e 25 QQuickWindowPrivate::renderSceneGraph qquickwindow.cpp 486 0x8615fe4 26 QSGRenderThread::syncAndRender qsgthreadedrenderloop.cpp 646 0x85c2101 27 QSGRenderThread::run qsgthreadedrenderloop.cpp 730 0x85c577c 28 QThreadPrivate::start qthread_unix.cpp 361 0x942368e 29 start_thread pthread_create.c 333 0xa28f6ba 30 clone clone.S 109 0x9fc541d
The problem seems to be that we are calling this GL function with an int when it takes an unsigned int. To be clear, we are using values passed from QSize which can be a negative int if the QSize is invalid and implicitly converting them to unsigned int resulting in unintialized values.