From 666b4ee51445f5c504cc07231edf32562944423b Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Fri, 17 Jul 2026 09:38:49 -0700 Subject: [PATCH] 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 --- source/rotate_argb.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/rotate_argb.cc b/source/rotate_argb.cc index 6342b0647..c2e2637a1 100644 --- a/source/rotate_argb.cc +++ b/source/rotate_argb.cc @@ -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;