QTiffHandler: close() also corrupt files early


Every other early return in read() does

  d->close();
  return false;

except the "Corrupt image" one. While the file will eventually be
closed by the dtor, the asymmetry is raising eyebrows and can delay
freeing resources, so restore the class' former "failed read → handle
closed" invariant.

Expand the comment a bit to ensure readers understand why this check
is up-front.

Amends 4f83c3ebfdb2bc97162ac1065091c195b60ff5fb (picked to 5.15).

Picking all the way as a fixup to QTBUG-107223, which has a
SecurityIssue label.

Task-number: QTBUG-107223
Pick-to: 6.12 6.11 6.8 6.5 5.15
Change-Id: I900d327f2e8d68241dc658d1b3c32cbc7687e42b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
commit62ebe2184f84a407aa82730b5f30889c18b45c32
parent686ec710a3499b8fa77eb0b7387c688f80e2579a
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeTue, 21 Jul 2026 06:25:15 +0000