]> granicus.if.org Git - openjpeg/commitdiff
[trunk] rework code from r2463. Really there has been some code duplication from...
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 15:04:24 +0000 (15:04 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 15:04:24 +0000 (15:04 +0000)
Thanks to John Rogers (oracle.com) for report

src/lib/openjp2/jp2.c

index 7ed9a54c0eef8bee3b75ad4d45f25c02929c06fa..51ddab01af97fb1863a6edc69a72791452ad32cc 100644 (file)
@@ -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)