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

heap overflow in planarYUV420_to_ARGB32

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8
    • Multimedia
    • None
    • Linux/X11
    • Multimedia wk 17-18

    Description

      updating my gpu driver without rebooting, i ran into this heap overflow in QVideoFrame::toImage:

      =================================================================
      ==246500==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x533000019760 at pc 0x7ee971cf836d bp 0x7ffc61438fc0 sp 0x7ffc61438fb8
      WRITE of size 4 at 0x533000019760 thread T0
          #0 0x7ee971cf836c in planarYUV420_to_ARGB32(unsigned char const*, int, unsigned char const*, int, unsigned char const*, int, int, unsigned int*, int, int) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconversionhelper.cpp:53:21
          #1 0x7ee971cf6306 in qt_convert_YUV420P_to_ARGB32(QVideoFrame const&, unsigned char*) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconversionhelper.cpp:100:5
          #2 0x7ee971d0053c in convertCPU(QVideoFrame const&, QtVideo::Rotation, bool, bool) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconverter.cpp:282:9
          #3 0x7ee971cfd2fa in qImageFromVideoFrame(QVideoFrame const&, QtVideo::Rotation, bool, bool) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconverter.cpp:322:16
          #4 0x7ee971cd57d9 in QVideoFrame::toImage() const /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframe.cpp:726:20
          #5 0x63f5d1465a81 in tst_QMediaPlayerBackend::seekPauseSeek() /home/tim/dev/qt6-dev/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp:1622:30
          #6 0x63f5d14bba6c in tst_QMediaPlayerBackend::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/tim/build/build-qt6-dev-clang_17_qt_dev-Debug2/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend_autogen/include/tst_qmediaplayerbackend.moc:577:22
          #7 0x7ee967c4ca28 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.cpp:2754:13
          #8 0x7ee967c60f0d in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.cpp:2593:13
          #9 0x7ee9720e0f5f in std::enable_if<!AreOldStyleArgs<>::value, bool>::type QMetaMethod::invoke<void>(QObject*, Qt::ConnectionType, QTemplatedMetaMethodReturnArgument<void>) const /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.h:148:16
          #10 0x7ee9720e0b00 in std::enable_if<!AreOldStyleArgs<>::value, bool>::type QMetaMethod::invoke<>(QObject*, Qt::ConnectionType) const /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.h:160:16
          #11 0x7ee9720b08d5 in QTest::invokeTestMethodIfValid(QMetaMethod, QObject*) /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:448:18
          #12 0x7ee9720af7de in QTest::TestMethods::invokeTestOnData(int) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1086:28
          #13 0x7ee9720b2214 in QTest::TestMethods::invokeTest(int, QLatin1String, std::optional<QTest::WatchDog>&) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1388:21
          #14 0x7ee9720b773b in QTest::TestMethods::invokeTests(QObject*) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1725:33
          #15 0x7ee9720b9765 in QTest::qRun() /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1930:18
          #16 0x7ee9720b8022 in QTest::qExec(QObject*, int, char**) /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1808:15
          #17 0x63f5d14bb55d in main /home/tim/dev/qt6-dev/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp:3011:452
          #18 0x7ee966e2814f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
          #19 0x7ee966e28208 in __libc_start_main csu/../csu/libc-start.c:360:3
          #20 0x63f5d1280ac4 in _start (/home/tim/build/build-qt6-dev-clang_17_qt_dev-Debug2/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend+0x4fac4) (BuildId: 55a26874a72967cb17e205ae71fb906cfc338517)
      
      0x533000019760 is located 0 bytes after 102240-byte region [0x533000000800,0x533000019760)
      allocated by thread T0 here:
          #0 0x63f5d131efc2 in malloc (/home/tim/build/build-qt6-dev-clang_17_qt_dev-Debug2/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend+0xedfc2) (BuildId: 55a26874a72967cb17e205ae71fb906cfc338517)
          #1 0x7ee96cc8832c in QImageData::create(QSize const&, QImage::Format) /home/tim/dev/qt6-dev/qtbase/src/gui/image/qimage.cpp:145:25
          #2 0x7ee96cc8a65f in QImage::QImage(QSize const&, QImage::Format) /home/tim/dev/qt6-dev/qtbase/src/gui/image/qimage.cpp:801:9
          #3 0x7ee96cc8a580 in QImage::QImage(int, int, QImage::Format) /home/tim/dev/qt6-dev/qtbase/src/gui/image/qimage.cpp:785:7
          #4 0x7ee971d00518 in convertCPU(QVideoFrame const&, QtVideo::Rotation, bool, bool) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconverter.cpp:281:24
          #5 0x7ee971cfd2fa in qImageFromVideoFrame(QVideoFrame const&, QtVideo::Rotation, bool, bool) /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconverter.cpp:322:16
          #6 0x7ee971cd57d9 in QVideoFrame::toImage() const /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframe.cpp:726:20
          #7 0x63f5d1465a81 in tst_QMediaPlayerBackend::seekPauseSeek() /home/tim/dev/qt6-dev/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp:1622:30
          #8 0x63f5d14bba6c in tst_QMediaPlayerBackend::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/tim/build/build-qt6-dev-clang_17_qt_dev-Debug2/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend_autogen/include/tst_qmediaplayerbackend.moc:577:22
          #9 0x7ee967c4ca28 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.cpp:2754:13
          #10 0x7ee967c60f0d in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.cpp:2593:13
          #11 0x7ee9720e0f5f in std::enable_if<!AreOldStyleArgs<>::value, bool>::type QMetaMethod::invoke<void>(QObject*, Qt::ConnectionType, QTemplatedMetaMethodReturnArgument<void>) const /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.h:148:16
          #12 0x7ee9720e0b00 in std::enable_if<!AreOldStyleArgs<>::value, bool>::type QMetaMethod::invoke<>(QObject*, Qt::ConnectionType) const /home/tim/dev/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.h:160:16
          #13 0x7ee9720b08d5 in QTest::invokeTestMethodIfValid(QMetaMethod, QObject*) /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:448:18
          #14 0x7ee9720af7de in QTest::TestMethods::invokeTestOnData(int) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1086:28
          #15 0x7ee9720b2214 in QTest::TestMethods::invokeTest(int, QLatin1String, std::optional<QTest::WatchDog>&) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1388:21
          #16 0x7ee9720b773b in QTest::TestMethods::invokeTests(QObject*) const /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1725:33
          #17 0x7ee9720b9765 in QTest::qRun() /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1930:18
          #18 0x7ee9720b8022 in QTest::qExec(QObject*, int, char**) /home/tim/dev/qt6-dev/qtbase/src/testlib/qtestcase.cpp:1808:15
          #19 0x63f5d14bb55d in main /home/tim/dev/qt6-dev/qtmultimedia/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp:3011:452
          #20 0x7ee966e2814f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
      
      SUMMARY: AddressSanitizer: heap-buffer-overflow /home/tim/dev/qt6-dev/qtmultimedia/src/multimedia/video/qvideoframeconversionhelper.cpp:53:21 in planarYUV420_to_ARGB32(unsigned char const*, int, unsigned char const*, int, unsigned char const*, int, int, unsigned int*, int, int)
      Shadow bytes around the buggy address:
        0x533000019480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x533000019500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x533000019580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x533000019600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x533000019680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      =>0x533000019700: 00 00 00 00 00 00 00 00 00 00 00 00[fa]fa fa fa
        0x533000019780: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x533000019800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x533000019880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x533000019900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x533000019980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07 
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      ==246500==ABORTING
      

      Attachments

        Issue Links

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

          Activity

            People

              timblechmann tim blechmann
              timblechmann tim blechmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes