Fix implicit narrowing cast

Bug: b/152777669
Change-Id: I271ca0ecb5ff8461530fd6388378524970a2bc2b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43228
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Renderer/Surface.cpp b/src/Renderer/Surface.cpp
index 529cf09..ca4771f 100644
--- a/src/Renderer/Surface.cpp
+++ b/src/Renderer/Surface.cpp
@@ -2681,7 +2681,7 @@
 				// and stencil operations also read 8 bytes per four 8-bit stencil values,
 				// so we have to allocate 4 extra bytes to avoid buffer overruns.
 			    // TODO(b/145229887): Eliminate if possible, or don't hard-code.
-				return size + 4;
+				return static_cast<size_t>(size) + 4;
 			}
 		case FORMAT_YV12_BT601:
 		case FORMAT_YV12_BT709: