summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstackexploit <stackexploit@gmail.com>2016-09-19 06:07:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-19 06:07:27 -0700
commita0ff010a380c98d2092ff849ffc2f672e87fc799 (patch)
tree4a636da14c5c24ecc4fcb5e99dd72221fd419d10
parente9988dd65e743a9b70482aa3007cec2c9789f679 (diff)
downloadpdfium-a0ff010a380c98d2092ff849ffc2f672e87fc799.tar.xz
Avoid nullptr access in sycc422_to_rgb and sycc420_to_rgb
BUG=648127 Review-Url: https://codereview.chromium.org/2351623002
-rw-r--r--core/fxcodec/codec/fx_codec_jpx_opj.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index a1c38d06e9..e64fa471cd 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -247,6 +247,9 @@ static void sycc422_to_rgb(opj_image_t* img) {
const int* y = img->comps[0].data;
const int* cb = img->comps[1].data;
const int* cr = img->comps[2].data;
+ if (!y || !cb || !cr)
+ return;
+
int *d0, *d1, *d2, *r, *g, *b;
d0 = r = FX_Alloc(int, max_size.ValueOrDie());
d1 = g = FX_Alloc(int, max_size.ValueOrDie());
@@ -324,6 +327,9 @@ void sycc420_to_rgb(opj_image_t* img) {
const int* y = img->comps[0].data;
const int* cb = img->comps[1].data;
const int* cr = img->comps[2].data;
+ if (!y || !cb || !cr)
+ return;
+
const int* ny = nullptr;
int* nr = nullptr;
int* ng = nullptr;