Harden TGA handler


Reject truncated images. The decodeer could do much unneeded
allocation and decoding work on truncated image files. Instead check
the available data in device and bail out early on truncated input.

As a driveby, fix a decoding error on fiels having a non-zero offset
field: the offset jump was done twice, with both a loop and a
seek. Drop the loop.

Task-number: QTBUG-148326
Pick-to: 6.12
Change-Id: Idceb975f07b906ad8a59a090012e30f90545426d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit5dbc05a210c90f8dd75962a8ac67e17330e08fc5
parentc5d5ad504eb0e881425003f315e4a58bc5d8ea90
authorEirik Aavitsland <eirik.aavitsland@qt.io>
committerEirik Aavitsland <eirik.aavitsland@qt.io>
commit timeTue, 1 Sep 2026 07:45:45 +0000