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

Memory Leak in QImageVideoBufferPrivate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.15.8
    • GUI: Other
    • None

    Description

      When a QVideoFrame is constructed using a QImage, it creates a QImageVideoBufferPrivate object. Internally QImageVideoBufferPrivate calls the `QImage::bits()` function, twice. The documentation for this function states the following:

      > Note that QImage uses implicit data sharing. This function performs a deep copy of the shared pixel data, thus ensuring that this QImage is the only one using the current return value.

      QImageVideoBufferPrivate never cleans up these copies, resulting in a memory leak.

      In my use case this was quite sizeable, as each frame was about 24 MB, and the program would crash to an allocation failure in a couple of minutes. For the moment I working around this by subclassing QAbstractVideoBuffer and passing an instance my custom class to QVideoFrame.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            geemili LeRoyce Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes