summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-19 14:56:52 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-19 14:56:52 -0700
commitbf4aa2cc93a67826247e887b2ba26a1b965eb616 (patch)
treea1d6336676d6d70467a7fb94aa0e625b1dbc8c25 /core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
parenteb6527763171cdb4b0fbfea5a20d691f4d67b660 (diff)
downloadpdfium-bf4aa2cc93a67826247e887b2ba26a1b965eb616.tar.xz
Revert "Remove FX_Alloc() null checks now that it can't return NULL."
This reverts commit eb6527763171cdb4b0fbfea5a20d691f4d67b660. Reason for revert: broke javascript tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1145843005
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_jpx_opj.cpp')
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index 1a1616c0a1..3546f574f9 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -715,8 +715,14 @@ FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateCo
}
FXSYS_memset8(dest_buf, 0xff, image->y1 * pitch);
FX_BYTE** channel_bufs = FX_Alloc(FX_BYTE*, image->numcomps);
+ if (channel_bufs == NULL) {
+ return FALSE;
+ }
FX_BOOL result = FALSE;
int* adjust_comps = FX_Alloc(int, image->numcomps);
+ if (adjust_comps == NULL) {
+ goto done;
+ }
for (i = 0; i < (int)image->numcomps; i ++) {
channel_bufs[i] = dest_buf + offsets[i];
adjust_comps[i] = image->comps[i].prec - 8;