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>