mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
fix invalid check for buffer size
BUG=webp:383,webp:512 Change-Id: I8ebbb5ca4860d73c3b59b12e238b54a89184bed0 (cherry picked from commit71ed73cf86
) (cherry picked from commitdad31750e3
)
This commit is contained in:
parent
1f14632a18
commit
16fc937d2e
@ -74,7 +74,8 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) {
|
|||||||
} else { // RGB checks
|
} else { // RGB checks
|
||||||
const WebPRGBABuffer* const buf = &buffer->u.RGBA;
|
const WebPRGBABuffer* const buf = &buffer->u.RGBA;
|
||||||
const int stride = abs(buf->stride);
|
const int stride = abs(buf->stride);
|
||||||
const uint64_t size = MIN_BUFFER_SIZE(width, height, stride);
|
const uint64_t size =
|
||||||
|
MIN_BUFFER_SIZE(width * kModeBpp[mode], height, stride);
|
||||||
ok &= (size <= buf->size);
|
ok &= (size <= buf->size);
|
||||||
ok &= (stride >= width * kModeBpp[mode]);
|
ok &= (stride >= width * kModeBpp[mode]);
|
||||||
ok &= (buf->rgba != NULL);
|
ok &= (buf->rgba != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user