ARGBRotate180: Check if width * 4 would overflow

Change-Id: I1fd4ad42a282690c3f9ac0ea8b3874efb4d8c2ee
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8117147
Reviewed-by: Frank Barchard <fbarchard@google.com>
This commit is contained in:
Wan-Teh Chang 2026-07-17 09:38:49 -07:00 committed by Frank Barchard
parent c302f85bb1
commit 666b4ee514

View File

@ -122,6 +122,9 @@ static int ARGBRotate180(const uint8_t* src_argb,
ARGBMirrorRow_C;
void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =
CopyRow_C;
if (width > INT_MAX / 4) {
return -1;
}
align_buffer_64(row, width * 4);
if (!row)
return 1;