summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/fx_codec_jpx_opj.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index ed9331974d..a1c38d06e9 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -231,6 +231,9 @@ static void sycc422_to_rgb(opj_image_t* img) {
return;
int prec = img->comps[0].prec;
+ if (prec <= 0 || prec >= 32)
+ return;
+
int offset = 1 << (prec - 1);
int upb = (1 << prec) - 1;