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

QGLWidget::renderText may cause heap corruption

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.x
    • 4.8.1
    • GUI: OpenGL
    • None
    • Windows 7 x64, build with msvc2010 for 64bit app.
    • 17f263905f00dfd0f01d9f5226ac06b07aa9d421

    Description

      I got a heap corruption( according to _CrtCheckMemory() ) when using QGLWidget::renderText, with some specific parameters.

      In the following code sample:
      assert( _CrtCheckMemory() );
      renderText( x + (max_height/4.0) * w, y + (fm.descent() + (label.shadedText ? 1.0 : 0.0)) * h, 0.0, temp_string, label.font );
      assert( _CrtCheckMemory() );

      the second _CrtCheckMemory call returns false indicating a heap corruption.
      The label parameter is a valid a object, so as the widget. fm is a QFontMetricsF object and temp_string is a QString.

      Concrete parameters which are handed over the rendertext function:
      void QGLWidget::renderText( 7.5, 106.0, 0.0, "Th 2.90", ( a font with family="Courier New" styleName="" pointSize=8.0), int)

      Attachments

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

        Activity

          People

            rodal Samuel Rødal
            fr3d741 Fred
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes