[webp] Fix wrong filesize parameter being extracted from the header

The webp header contains the filesize of the image starting at the 8th byte in
bytes 4 to 8 encoded as a little endian 32 bit unsigned integer. The code was
erroneously assuming that the extracted filesize is starting at the 12th byte,
i.e. at the end of the WebP file header.

Source: https://developers.google.com/speed/webp/docs/riff_container
This commit is contained in:
Dan Čermák 2018-03-26 00:29:11 +02:00
parent be992520b1
commit 49db96cd58

View File

@ -490,7 +490,7 @@ namespace Exiv2 {
io_->read(data, WEBP_TAG_SIZE * 3);
WebPImage::decodeChunks(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian) + 12);
WebPImage::decodeChunks(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian) + 8);
} // WebPImage::readMetadata