Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick of patch originally reviewed on https://chromium-review.googlesource.com/c/webm/libwebp/+/4634862: EncodeAlphaInternal: add missing error check VP8LBitWriterFinish() may cause the VP8LBitWriter's buffer to be grown. If that allocation fails, VP8LBitWriterNumBytes() will return a size larger than the current allocation resulting in a heap overwrite of the missing bytes. ==13==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61900005b880 at pc 0x00000049ffc1 bp 0x7fff144f5b40 sp 0x7fff144f5310 READ of size 1028 at 0x61900005b880 thread T0 #0 0x49ffc0 in __asan_memcpy #1 0x695861 in VP8BitWriterAppend src/utils/bit_writer_utils.c:186:3 #2 0x65acf9 in EncodeAlphaInternal src/enc/alpha_enc.c:169:14 Found by Nallocfuzz (https://github.com/catenacyber/nallocfuzz). This is the same issue that was fixed in the non-alpha lossless path in: d49cfbb3 vp8l_enc,WriteImage: add missing error check Bug: chromium:1455619 Change-Id: I6bd10de213707d3d6b7ce3d0d2b3942af45d317f (cherry picked from commit c3bd7cff2e57b4bf1b744e70dd379570d83fb0e4) Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/500280 Reviewed-by: Michal Klocek <[email protected]>
- Loading branch information