Prevent segfault later down in the pipeline

This commit is contained in:
Mathieu Malaterre 2010-07-01 17:40:57 +00:00
parent 889aa9227b
commit cab60a170d
1 changed files with 5 additions and 0 deletions

View File

@ -3353,6 +3353,11 @@ bool j2k_read_SQcd_SQcc(
else
{
l_num_band = (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) ? (*p_header_size) : (*p_header_size) / 2;
if( l_num_band > J2K_MAXBANDS )
{
opj_event_msg(p_manager, EVT_ERROR, "Error reading CCP_QNTSTY element\n");
return false;
}
}
#ifdef USE_JPWL