Fix integer overflow in EmitFancyRGB.

+ enhance the assert in WebPCopyPlane()

Change-Id: Id9b01d00a8dce6caf0d4721a6fbe8def40b8bb85
This commit is contained in:
Vincent Rabaud
2020-05-05 14:31:49 +02:00
parent b3ff0bdec1
commit e3c259a278
2 changed files with 25 additions and 30 deletions

View File

@ -231,7 +231,7 @@ void WebPFree(void* ptr) {
void WebPCopyPlane(const uint8_t* src, int src_stride,
uint8_t* dst, int dst_stride, int width, int height) {
assert(src != NULL && dst != NULL);
assert(src_stride >= width && dst_stride >= width);
assert(abs(src_stride) >= width && abs(dst_stride) >= width);
while (height-- > 0) {
memcpy(dst, src, width);
src += src_stride;