From: Mathieu Malaterre Date: Fri, 14 Mar 2014 15:04:24 +0000 (+0000) Subject: [trunk] rework code from r2463. Really there has been some code duplication from... X-Git-Tag: version.2.0.1~4^2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e91877636fc1a663087e783f7ce93cf44843204;p=openjpeg [trunk] rework code from r2463. Really there has been some code duplication from r2413 Thanks to John Rogers (oracle.com) for report --- diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index 7ed9a54c..51ddab01 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -1002,11 +1002,6 @@ OPJ_BOOL opj_jp2_read_pclr( opj_jp2_t *jp2, for(i = 0; i < nr_channels; ++i) { 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)) 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)