Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
muxread: fix reading of buffers > riff size
After: 2c70ad7 muxread,CreateInternal: fix riff size checks (cl/200674839) `SizeWithPadding()` adds `CHUNK_HEADER_SIZE` (plus additional 1 byte padding if needed). A later check included `CHUNK_HEADER_SIZE` before capping the value of the size passed to `WebPMuxCreateInternal()`, missing cases with a small amount of extra data after the RIFF chunk (like a newline when the file is opened and saved in a text editor) and setting size to an incorrect value, so larger sizes would also fail. Another check of `riff_size < CHUNK_HEADER_SIZE` after the call to `SizeWithPadding()` is removed because 1) it could not fail given `SizeWithPadding()` adds `CHUNK_HEADER_SIZE` to the value; and 2) it is redundant as `size < RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE` is checked earlier in the function. Bug: webp:42340561 Change-Id: I58dc4f071b27c2841001b4012aabdb1869f64f97
- Loading branch information