Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76998

Uninitialized values used by distance field glyph cache calling glCopyTexSubImge2D

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            atreat Adam Treat
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes