Fix unsafe size arithmetic in the texture loaders


QSSG_CHECK_X has no action: it logs and falls through, and under
QT_BUILD_INTERNAL that log is a qFatal. Four call sites used it to
reject an oversized buffer and then carried on regardless, so the size
truncated to quint32 while the dimensions kept their full values and the
decode or the upload ran past the allocation. A 56 byte .hdr header
reaches it. Size in qsizetype with qMulOverflow, return on failure, and
check the malloc.

loadTextureData() also took dataSizeInBytes from what a
QQuick3DTextureData declares without comparing it against the bytes
supplied, and sized rows with an aligned pitch the upload does not
honour. Size them tightly packed, as setRhiTexture() already does for
3D, and reject data too small for what it claims to be.

loadExr() left the R, G and B channel indices at -1 when no channel
matched, then indexed the plane array with -1.

Pick-to: 6.12 6.11 6.8
Change-Id: Ic54eb39935ccc570f038554137dfd1b1efc8590f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
commitbe64789e344de50b5e37c5f21fb69b844f4e2897
parenta372562447b34149b6c2958ed034751c20c17adc
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeThu, 10 Sep 2026 11:41:36 +0000