Fixed SVACE issues in ktx-loader.cpp + general maintenance. 89/226289/3
authorGyörgy Straub <g.straub@partner.samsung.com>
Fri, 28 Feb 2020 16:38:22 +0000 (16:38 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Tue, 3 Mar 2020 16:13:25 +0000 (16:13 +0000)
commit9481b0a194dbb2045d84b327a59b1154eebda87d
treec51e9cd43ef5eb72cf99902486f6d7b2d671db04
parentb15bfd014dc5256883442603549fdc10b5002a8f
Fixed SVACE issues in ktx-loader.cpp + general maintenance.

- simplified the navigation of the file stream: the ktx metadata is
  skipped with a single fseek() from SEEK_CUR, by the number of bytes
  known from the ktx header;
- removed the allocation of a single large buffer: image data is read
  from file, per image, directly into a buffer to be transferred to
  PixelData;
- using std::unique_ptr<> to manage the scope of the file handle and
  image buffer;
- removed local arrays of image sizes and buffer pointers as a total
  of no more than one of these is used at any given time;

Change-Id: If51688568dd90dc1117b3c9a0de10f6c429bd394
Signed-off-by: György Straub <g.straub@partner.samsung.com>
examples/rendering-basic-pbr/ktx-loader.cpp