mirror of
https://github.com/webmproject/libwebp.git
synced 2026-04-09 14:22:31 +02:00
Fix some potential integer overflows.
Bug: 483655390, 496629074, 496629076 Change-Id: Idba72361915f1ecf37532a306636011001c27755
This commit is contained in:
@@ -34,9 +34,15 @@ static int AdditionWillOverflow(int a, int b) {
|
||||
}
|
||||
|
||||
static int FramesAreEqual(const uint8_t* const rgba1,
|
||||
const uint8_t* const rgba2, int width, int height) {
|
||||
const int stride = width * 4; // Always true for 'DecodedFrame.rgba'.
|
||||
return !memcmp(rgba1, rgba2, stride * height);
|
||||
const uint8_t* const rgba2, uint32_t width,
|
||||
uint32_t height) {
|
||||
// Always * 4 for 'DecodedFrame.rgba'.
|
||||
const uint32_t stride = width * 4;
|
||||
size_t size;
|
||||
if (!CheckMultiplicationOverflow(stride, height, &size)) {
|
||||
return 0;
|
||||
}
|
||||
return !memcmp(rgba1, rgba2, size);
|
||||
}
|
||||
|
||||
static WEBP_INLINE int PixelsAreSimilar(uint32_t src, uint32_t dst,
|
||||
|
||||
Reference in New Issue
Block a user