From a8a477ae6785458eef35c237aa7da5aff15fa80c Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 23 Sep 2022 18:04:43 +0200 Subject: [PATCH] pcx: Do not support sequential devices We need QIODevice::pos() to work in QDataStream &operator>>. BUG: 459541 --- src/imageformats/pcx.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/imageformats/pcx.cpp b/src/imageformats/pcx.cpp index ddde33e..e9b0a23 100644 --- a/src/imageformats/pcx.cpp +++ b/src/imageformats/pcx.cpp @@ -684,6 +684,12 @@ bool PCXHandler::canRead(QIODevice *device) return false; } + // We do not support sequential images + // We need to know the current position to properly read the header + if (device->isSequential()) { + return false; + } + qint64 oldPos = device->pos(); char head[1];