rcc: Fix bad data signature recognition

Done-by: Mathias Hasselmann
Fixes: QTBUG-73834
Change-Id: I99c480a2ef50ed110e0d98a9dd56661ea851397a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk 2023-06-06 16:29:18 +02:00
parent 53fa325f4c
commit fe5d9340b1

View File

@ -929,13 +929,17 @@ bool RCCResourceLibrary::output(QIODevice &outDevice, QIODevice &tempDevice, QIO
m_errorDevice->write("No data signature found\n");
return false;
}
if (c != pattern[i]) {
for (int k = 0; k < i; ++k)
outDevice.putChar(pattern[k]);
i = 0;
}
if (c == pattern[i]) {
++i;
} else {
for (int k = 0; k < i; ++k)
outDevice.putChar(pattern[k]);
outDevice.putChar(c);
i = 0;
}
}