diff options
Diffstat (limited to 'src/gui/image/qimage_conversions.cpp')
-rw-r--r-- | src/gui/image/qimage_conversions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index e804b3b788..9257ab8cfe 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -237,7 +237,7 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio segments = std::min(segments, src->height); QThreadPool *threadPool = QThreadPool::globalInstance(); - if (segments <= 1 || threadPool->contains(QThread::currentThread())) + if (segments <= 1 || !threadPool || threadPool->contains(QThread::currentThread())) return convertSegment(0, src->height); QSemaphore semaphore; @@ -292,7 +292,7 @@ void convert_generic_to_rgb64(QImageData *dest, const QImageData *src, Qt::Image segments = std::min(segments, src->height); QThreadPool *threadPool = QThreadPool::globalInstance(); - if (segments <= 1 || threadPool->contains(QThread::currentThread())) + if (segments <= 1 || !threadPool || threadPool->contains(QThread::currentThread())) return convertSegment(0, src->height); QSemaphore semaphore; @@ -399,7 +399,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im int segments = data->nbytes / (1<<16); segments = std::min(segments, data->height); QThreadPool *threadPool = QThreadPool::globalInstance(); - if (segments > 1 && !threadPool->contains(QThread::currentThread())) { + if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { QSemaphore semaphore; int y = 0; for (int i = 0; i < segments; ++i) { |