Make sure the stride has a minimum value in the importer.

Bug: webp:569
Change-Id: Ia48d064dbb10e7179ae3da04ca8d769d1c447276
This commit is contained in:
Vincent Rabaud 2022-05-10 10:18:46 +02:00
parent 0c8b0e67a4
commit 6c45cef7ff

View File

@ -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,