summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_HtrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_HtrdProc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
index fb2257e853..7d11482225 100644
--- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
@@ -117,6 +117,9 @@ std::unique_ptr<CJBig2_Image> CJBig2_HTRDProc::DecodeMMR(
std::unique_ptr<CJBig2_Image> CJBig2_HTRDProc::DecodeImage(
const std::vector<std::unique_ptr<CJBig2_Image>>& GSPLANES) {
auto HTREG = pdfium::MakeUnique<CJBig2_Image>(HBW, HBH);
+ if (!HTREG->data())
+ return nullptr;
+
HTREG->fill(HDEFPIXEL);
std::vector<uint32_t> GSVALS(HGW * HGH);
for (uint32_t y = 0; y < HGH; ++y) {