screencast: Properly detect the fallback

Do not check an it that is the container's end()
This commit is contained in:
Aleix Pol 2023-03-13 17:44:44 +01:00 committed by Vlad Zahorodnii
parent bacc35c236
commit 1cbc9185fb

View file

@ -345,7 +345,7 @@ bool ScreenCastStream::createStream()
// If the offered format is not available for dmabuf, prefer converting to another one than resorting to memfd
if (itModifiers == supported.constEnd() && !supported.isEmpty()) {
itModifiers = supported.constFind(DRM_FORMAT_ARGB8888);
if (itModifiers == supported.constEnd()) {
if (itModifiers != supported.constEnd()) {
m_drmFormat = itModifiers.key();
}
}