ryanqq / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

read: segment too long (6182) with max (35872) for codeblock 0 (p=19, b=2, r=5, c=1) #284

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The attached file (see issue 135 for construction) fails to decode in current 
openjpeg:

read: segment too long (6182) with max (35872) for codeblock 0 (p=19, b=2, r=5, 
c=1)
[ERROR] Failed to decode.
[ERROR] Failed to decode tile 1/1
ERROR -> opj_decompress: failed to decode image!

Original issue reported on code.google.com by mathieu.malaterre on 12 Mar 2014 at 3:40

Attachments:

GoogleCodeExporter commented 9 years ago
I suspect issue comes from r2266. Indeed code read as:

                                if (l_current_data + l_seg->newlen > p_src_data + p_max_length) {
                                        return OPJ_FALSE;
                                }
[...]
                                if ((l_cblk->data_current_size + l_seg->newlen) > l_cblk->data_max_size) {
                                    OPJ_BYTE* new_cblk_data = (OPJ_BYTE*) opj_realloc(l_cblk->data, l_cblk->data_current_size + l_seg->newlen);

Original comment by mathieu.malaterre on 12 Mar 2014 at 3:41

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 14 Mar 2014 at 2:04