summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch')
-rw-r--r--third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch b/third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch
new file mode 100644
index 0000000000..58f04b0a24
--- /dev/null
+++ b/third_party/libopenjpeg20/0033-undefined-shift-opj_t1_dec_clnpass.patch
@@ -0,0 +1,14 @@
+diff --git a/third_party/libopenjpeg20/t1.c b/third_party/libopenjpeg20/t1.c
+index 1ad850c77..d290c38d5 100644
+--- a/third_party/libopenjpeg20/t1.c
++++ b/third_party/libopenjpeg20/t1.c
+@@ -1387,6 +1387,9 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
+ }
+
+ bpno_plus_one = (OPJ_INT32)(roishift + cblk->numbps);
++ if (bpno_plus_one > 30) {
++ return OPJ_FALSE;
++ }
+ passtype = 2;
+
+ opj_mqc_resetstates(mqc);