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 9627025164..74ab5f277d 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -162,6 +162,9 @@ static void sycc_to_rgb(int offset,
static void sycc444_to_rgb(opj_image_t* img) {
int prec = img->comps[0].prec;
+ // If we shift 31 we're going to go negative, then things go bad.
+ if (prec > 30)
+ return;
int offset = 1 << (prec - 1);
int upb = (1 << prec) - 1;
OPJ_UINT32 maxw =