diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-05-11 15:48:11 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-05-14 11:45:41 +0200 |
| commit | 2641a665fbcf1d0326bde6e4f610e775881f8430 (patch) | |
| tree | 50222fe86d2d652df80a15719eb11fbe5cc9cc2b /examples/scriptableapplication/pythonutils.cpp | |
| parent | 967be4ead8781da67b71b177d124764de5fd0aa3 (diff) | |
Fix crashes when using the QImage(uchar *) data constructors
The constructors expect a range of memory that remains valid
through the lifetime of the image and may also modify it.
Crashes occurred since apparently the Py_Buffer was released before
it.
To fix this, add a new buffer helper, copyData() that makes a copy
of the data and pass that along with std::free() as cleanup
function.
Fixes: PYSIDE-1563
Change-Id: Idb09eadea658f02968f75c6bdfc6cc3f467111d5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit cc011c8980cc4ce02e3d9cceb74ee028c204214e)
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/scriptableapplication/pythonutils.cpp')
0 files changed, 0 insertions, 0 deletions
