tests: fix memory access in testnotificationlistener
set the image data as QByteArray of the right size, otherwise referencing a stack-based char data will be problematic when the function is out of scope
This commit is contained in:
parent
4bcb40906b
commit
b6f280aedb
1 changed files with 1 additions and 1 deletions
|
@ -426,7 +426,7 @@ void TestNotificationListener::testNotify()
|
|||
0x31, 0x32, 0x33, 0x34 };
|
||||
QVariantMap imageData = {{"width", width}, {"height", height}, {"rowStride", rowStride},
|
||||
{"bitsPerSample", bitsPerSample}, {"channels", channels},
|
||||
{"hasAlpha", hasAlpha}, {"imageData", rawData}};
|
||||
{"hasAlpha", hasAlpha}, {"imageData", QByteArray(rawData, sizeof(rawData))}};
|
||||
QVariantMap hints;
|
||||
#define COMPARE_PIXEL(x, y) \
|
||||
QCOMPARE(qRed(image.pixel(x,y)), (int)rawData[x*4 + y*rowStride + 0]); \
|
||||
|
|
Loading…
Reference in a new issue