Add WARN_UNUSED_RESULT to ReadBlockAtOffset().

Make sure callers check the return value from
IFX_SeekableReadStream::ReadBlockAtOffset() calls. Fix up the one caller
that does not.

Change-Id: I44be552507314fab3f5c1204876d7697984f5336
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/60870
Reviewed-by: Chris Palmer <palmer@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 00f81b7..50db5da 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -141,8 +141,8 @@
   RetainPtr<CPDF_Dictionary> pDict = InitJPEG(data);
   if (!pDict && size > dwEstimateSize) {
     data.resize(size);
-    pFile->ReadBlockAtOffset(data.data(), 0, size);
-    pDict = InitJPEG(data);
+    if (pFile->ReadBlockAtOffset(data.data(), 0, size))
+      pDict = InitJPEG(data);
   }
   if (!pDict)
     return;
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index 81d010c..ef58660 100644
--- a/core/fxcrt/fx_stream.h
+++ b/core/fxcrt/fx_stream.h
@@ -10,6 +10,7 @@
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/retain_ptr.h"
+#include "third_party/base/compiler_specific.h"
 
 struct FX_FolderHandle;
 
@@ -75,7 +76,7 @@
 
   virtual bool ReadBlockAtOffset(void* buffer,
                                  FX_FILESIZE offset,
-                                 size_t size) = 0;
+                                 size_t size) WARN_UNUSED_RESULT = 0;
 };
 
 class IFX_SeekableStream : public IFX_SeekableReadStream,