From 7b72810801236cc0c25d0d515d2039db071c95bd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 12 Feb 2018 11:18:48 +0100 Subject: QWindowsNativeImage: Output parameters when CreateDIBSection() fails This helps to identify bugs in the backing store. Change-Id: Ib15946c8dbdc6f0a5bebe9ca9e6fea5668eb499b Reviewed-by: Oliver Wolff --- src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp') diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp index 67a6619b91..b1133dca22 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp @@ -101,8 +101,10 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height, uchar *bits = nullptr; HBITMAP bitmap = CreateDIBSection(hdc, reinterpret_cast(&bmi), DIB_RGB_COLORS, reinterpret_cast(&bits), 0, 0); - if (Q_UNLIKELY(!bitmap || !bits)) - qFatal("%s: CreateDIBSection failed.", __FUNCTION__); + if (Q_UNLIKELY(!bitmap || !bits)) { + qFatal("%s: CreateDIBSection failed (%dx%d, format: %d)", __FUNCTION__, + width, height, int(format)); + } *bitsIn = bits; return bitmap; -- cgit v1.2.3