mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Make sure the stride has a minimum value in the importer.
Bug: webp:569 Change-Id: Ia48d064dbb10e7179ae3da04ca8d769d1c447276
This commit is contained in:
parent
0c8b0e67a4
commit
6c45cef7ff
@ -739,6 +739,8 @@ static int Import(WebPPicture* const picture,
|
|||||||
const int width = picture->width;
|
const int width = picture->width;
|
||||||
const int height = picture->height;
|
const int height = picture->height;
|
||||||
|
|
||||||
|
if (abs(rgb_stride) < (import_alpha ? 4 : 3) * width) return 0;
|
||||||
|
|
||||||
if (!picture->use_argb) {
|
if (!picture->use_argb) {
|
||||||
const uint8_t* a_ptr = import_alpha ? rgb + 3 : NULL;
|
const uint8_t* a_ptr = import_alpha ? rgb + 3 : NULL;
|
||||||
return ImportYUVAFromRGBA(r_ptr, g_ptr, b_ptr, a_ptr, step, rgb_stride,
|
return ImportYUVAFromRGBA(r_ptr, g_ptr, b_ptr, a_ptr, step, rgb_stride,
|
||||||
|
Loading…
Reference in New Issue
Block a user