[trunk] rework code from r2463. Really there has been some code duplication from r2413
Thanks to John Rogers (oracle.com) for report
This commit is contained in:
parent
7e1d012161
commit
5e91877636
|
@ -1002,11 +1002,6 @@ OPJ_BOOL opj_jp2_read_pclr( opj_jp2_t *jp2,
|
||||||
for(i = 0; i < nr_channels; ++i) {
|
for(i = 0; i < nr_channels; ++i) {
|
||||||
OPJ_UINT32 bytes_to_read = (OPJ_UINT32)((channel_size[i]+7)>>3);
|
OPJ_UINT32 bytes_to_read = (OPJ_UINT32)((channel_size[i]+7)>>3);
|
||||||
|
|
||||||
if (bytes_to_read > sizeof(OPJ_UINT32))
|
|
||||||
bytes_to_read = sizeof(OPJ_UINT32);
|
|
||||||
if ((ptrdiff_t)p_pclr_header_size < p_pclr_header_data - orig_header_data + (ptrdiff_t)bytes_to_read)
|
|
||||||
return OPJ_FALSE;
|
|
||||||
|
|
||||||
if (bytes_to_read > sizeof(OPJ_UINT32))
|
if (bytes_to_read > sizeof(OPJ_UINT32))
|
||||||
bytes_to_read = sizeof(OPJ_UINT32);
|
bytes_to_read = sizeof(OPJ_UINT32);
|
||||||
if ((ptrdiff_t)p_pclr_header_size < p_pclr_header_data - orig_header_data + (ptrdiff_t)bytes_to_read)
|
if ((ptrdiff_t)p_pclr_header_size < p_pclr_header_data - orig_header_data + (ptrdiff_t)bytes_to_read)
|
||||||
|
|
Loading…
Reference in New Issue