Turn off optimizations of qt_depthForFormat on Windows Runtime ARM

This function is apparently optimized in a way that gives a bad return
value (or leaves the variable where it is used uninitialized), leading to
extreme memory allocations and eventual heap exhaustion.

Task-number: QTBUG-42038
Change-Id: Ia4ee9fc6475a0bf40e25eed356b027a4dc68d119
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
bb10
Andrew Knight 2014-11-25 13:31:20 +02:00 committed by Jani Heikkinen
parent 155306ffee
commit 9b01589e58
1 changed files with 6 additions and 0 deletions

View File

@ -116,6 +116,9 @@ void qInitImageConversions();
const uchar *qt_get_bitflip_array();
Q_GUI_EXPORT void qGamma_correct_back_to_linear_cs(QImage *image);
#if defined(Q_OS_WINRT) && defined(_M_ARM) // QTBUG-42038
#pragma optimize("", off)
#endif
inline int qt_depthForFormat(QImage::Format format)
{
int depth = 0;
@ -158,6 +161,9 @@ inline int qt_depthForFormat(QImage::Format format)
}
return depth;
}
#if defined(Q_OS_WINRT) && defined(_M_ARM)
#pragma optimize("", on)
#endif
QT_END_NAMESPACE