diff --git a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp index 0f682d1e..5093acb5 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp @@ -145,6 +145,10 @@ public: virtual int compare(const QSGMaterial *other) const { const QSGVideoMaterial_RGB *m = static_cast(other); + + if (!m_textureId) + return 1; + return m_textureId - m->m_textureId; } diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp index fd8d8719..500c1c62 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp @@ -138,6 +138,10 @@ public: virtual int compare(const QSGMaterial *other) const { const QSGVideoMaterial_Texture *m = static_cast(other); + + if (!m_textureId) + return 1; + int diff = m_textureId - m->m_textureId; if (diff) return diff; diff --git a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp index c920ba3b..af1e98cd 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp @@ -171,6 +171,9 @@ public: virtual int compare(const QSGMaterial *other) const { const QSGVideoMaterial_YUV *m = static_cast(other); + if (!m_textureIds[0]) + return 1; + int d = m_textureIds[0] - m->m_textureIds[0]; if (d) return d;