diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2015-10-13 15:28:55 +0800 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2015-10-13 00:49:26 -0700 |
commit | e865ed12c4a476a4c74bf1ae97d3a6fa8ca06f0a (patch) | |
tree | 9b2bad54f5afe41a627b0848347c3442f3c33635 /third_party/libopenjpeg20/0002-packet-iterator.patch | |
parent | a8a39e25af3c19bb91434fdf367cffa0e1536934 (diff) | |
download | pdfium-e865ed12c4a476a4c74bf1ae97d3a6fa8ca06f0a.tar.xz |
upgrade openjpeg to commit# cf352af
BUG=457480,497355
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1338973005 .
Diffstat (limited to 'third_party/libopenjpeg20/0002-packet-iterator.patch')
-rw-r--r-- | third_party/libopenjpeg20/0002-packet-iterator.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/libopenjpeg20/0002-packet-iterator.patch b/third_party/libopenjpeg20/0002-packet-iterator.patch new file mode 100644 index 0000000000..ac755ed03d --- /dev/null +++ b/third_party/libopenjpeg20/0002-packet-iterator.patch @@ -0,0 +1,27 @@ +diff --git a/third_party/libopenjpeg20/pi.c b/third_party/libopenjpeg20/pi.c +index 1697bcb..06f1e41 100644 +--- a/third_party/libopenjpeg20/pi.c ++++ b/third_party/libopenjpeg20/pi.c +@@ -36,6 +36,7 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + ++#include <limits.h> + #include "opj_includes.h" + + /** @defgroup PI PI - Implementation of a packet iterator */ +@@ -1236,7 +1237,13 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, + l_current_pi = l_pi; + + /* memory allocation for include */ +- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); ++ l_current_pi->include = 00; ++ if ++ (l_step_l && l_tcp->numlayers < UINT_MAX / l_step_l - 1) ++ { ++ l_current_pi->include = (OPJ_INT16*)opj_calloc((l_tcp->numlayers + 1) * l_step_l, sizeof(OPJ_INT16)); ++ } ++ + if + (!l_current_pi->include) + { |