mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
loosen the padding check on buffer size
Strictly speaking, the last (or first) row doesn't require padding. cf https://code.google.com/p/webp/issues/detail?id=258 Change-Id: Ie9ec8eb776fec1f5cea4cf9e21e81901fd79bf33
This commit is contained in:
parent
d623a8706f
commit
15ca5014f1
@ -67,7 +67,9 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) {
|
||||
} else { // RGB checks
|
||||
const WebPRGBABuffer* const buf = &buffer->u.RGBA;
|
||||
const int stride = abs(buf->stride);
|
||||
const uint64_t size = (uint64_t)stride * height;
|
||||
// strictly speaking, the very last (or first, if flipped) row
|
||||
// doesn't require padding.
|
||||
const uint64_t size = (uint64_t)stride * (height - 1) + width;
|
||||
ok &= (size <= buf->size);
|
||||
ok &= (stride >= width * kModeBpp[mode]);
|
||||
ok &= (buf->rgba != NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user