summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2014-10-06 21:05:27 +0000
committerAntonin Descampe <antonin@gmail.com>2014-10-06 21:05:27 +0000
commitf126eb0d41f475ed80190c94a071f59839b9a205 (patch)
treea528aebfb02f4b5ee0251c9c138ffecedaf40dcf /src/lib
parent7256e43c48ba5f7b1b8ee2927a52dc783a7ab3ed (diff)
[trunk] added box length inconsistency check
Update issue 364 issue364-38.patch applied. Thanks Matthieu.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/jp2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c
index d408d8e4..c77bfaae 100644
--- a/src/lib/openjp2/jp2.c
+++ b/src/lib/openjp2/jp2.c
@@ -2282,7 +2282,10 @@ OPJ_BOOL opj_jp2_read_boxhdr_char( opj_jp2_box_t *box,
opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box of undefined sizes\n");
return OPJ_FALSE;
}
-
+ if (box->length < *p_number_bytes_read) {
+ opj_event_msg(p_manager, EVT_ERROR, "Box length is inconsistent.\n");
+ return OPJ_FALSE;
+ }
return OPJ_TRUE;
}