[trunk] added box length inconsistency check

Update issue 364

issue364-38.patch applied. Thanks Matthieu.
This commit is contained in:
Antonin Descampe 2014-10-06 21:05:27 +00:00
parent 7256e43c48
commit f126eb0d41
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}