Use IsValueInRangeForNumericType() in CPDF_StreamParser.

In CPDF_StreamParser::ReadInlineStream(), use
IsValueInRangeForNumericType() to check if an uint32_t value will fit in
an int. It's more readable and less likely to be wrong than using
static_cast.

Change-Id: Ib8d7350acec909fbffe0dcc71b94363d3f07651e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/64974
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index 6d16458..25172a6 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -179,7 +179,7 @@
   } else {
     dwStreamSize = DecodeInlineStream(m_pBuf.subspan(m_Pos), width, height,
                                       decoder, pParam, dwOrigSize);
-    if (static_cast<int>(dwStreamSize) < 0)
+    if (!pdfium::base::IsValueInRangeForNumericType<int>(dwStreamSize))
       return nullptr;
 
     uint32_t dwSavePos = m_Pos;