mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 22:09:57 +02:00
add WebPCheckCropDimensions()
and avoid integer overflow in test of x/width and y/height parameters against the image width/height Bug: chromium:1196778, chromium:1196777, chromium:1196480 Change-Id: I7b8f1f4dbebfe073b1ba260b8317979488655dcc
This commit is contained in:
@ -188,8 +188,7 @@ VP8StatusCode WebPAllocateDecBuffer(int width, int height,
|
||||
const int ch = options->crop_height;
|
||||
const int x = options->crop_left & ~1;
|
||||
const int y = options->crop_top & ~1;
|
||||
if (x < 0 || y < 0 || cw <= 0 || ch <= 0 ||
|
||||
x + cw > width || y + ch > height) {
|
||||
if (!WebPCheckCropDimensions(width, height, x, y, cw, ch)) {
|
||||
return VP8_STATUS_INVALID_PARAM; // out of frame boundary.
|
||||
}
|
||||
width = cw;
|
||||
|
Reference in New Issue
Block a user