Skip to content

OpenJPEG 1.5.0 crashes on a ridiculously big file... #151

Closed
@gcode-importer

Description

Originally reported on Google Code with ID 151

What steps will reproduce the problem?
1. Download and unpack ftp://ftp.microimages.com/pub/tnt/data/jp2/gtopo30lossless.zip
(378MiByte) from http://www.microimages.com/gallery/jp2/
2. Execute gdb --args j2k_to_image -i g30mosLossless.jp2 -o test.raw
3. Run the tool inside gdb and obtain a backtrace

What is the expected output? What do you see instead?
I expect a decoded image and the relevant output from the tool.
Instead I see this and a segmentation fault:

[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (0) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (1) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (2) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (3) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (4) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (5) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (6) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (7) than number
of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (8) than number
of tile-parts (0)
[INFO] tile 1 of 1

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bcc076 in t1_decode_cblks (t1=0x8816180, tilec=0x612b80, tccp=0x612320)
at /home/usr/src/openjpeg-1.5.0/libopenjpeg/t1.c:1560
1560                                                                    ((int*)tiledp)[(j
* tile_w) + i] = tmp / 2;
(gdb) bt
#0  0x00007ffff7bcc076 in t1_decode_cblks (t1=0x8816180, tilec=0x612b80, tccp=0x612320)
at /home/usr/src/openjpeg-1.5.0/libopenjpeg/t1.c:1560
#1  0x00007ffff7bd3b66 in tcd_decode_tile (tcd=<optimized out>, 
    src=0x7fffb9b9a010 "\303\371fp\357\230sV\323\353j\004VV\312\337O\207U\331&\363\177k\220\267\a\376V\032\240\311f\an\031j\221\267\246\027\070#+\323`\313È\237\253\241\344]q\240ԟ\230\374j\264\347zJQ\326n7\034^*\336\306\323q\346\307w\371)\322dȗܜ\207\216诜\303\344\212\002\377!W\257\254\246\250\017\304\300",
len=395528744, tileno=0, cstr_info=<optimized out>) at /home/usr/src/openjpeg-1.5.0/libopenjpeg/tcd.c:1383
#2  0x00007ffff7bc22b7 in j2k_read_eoc (j2k=0x60f0c0) at /home/usr/src/openjpeg-1.5.0/libopenjpeg/j2k.c:1566
#3  0x00007ffff7bc34d9 in j2k_decode (j2k=0x60f0c0, cio=0x6107d0, cstr_info=<optimized
out>)
    at /home/usr/src/openjpeg-1.5.0/libopenjpeg/j2k.c:1877
#4  0x00007ffff7bc5c70 in opj_jp2_decode (jp2=0x60f050, cio=0x6107d0, cstr_info=<optimized
out>)
    at /home/usr/src/openjpeg-1.5.0/libopenjpeg/jp2.c:749
#5  0x000000000040231b in main (argc=<optimized out>, argv=<optimized out>)
    at /home/usr/src/openjpeg-1.5.0/applications/codec/j2k_to_image.c:717

What version of the product are you using? On what operating system?
OpenJPEG-1.5.0 on Debian.

Please provide any additional information below.
Running the same command in valgrind gives these printouts:

==23383== Warning: silly arg (-2812252756) to malloc()
==23383== Invalid write of size 4
==23383==    at 0x4E42076: t1_decode_cblks (t1.c:1560)
==23383==    by 0x4E49B65: tcd_decode_tile (tcd.c:1383)
==23383==    by 0x4E382B6: j2k_read_eoc (j2k.c:1566)
==23383==    by 0x4E394D8: j2k_decode (j2k.c:1877)
==23383==    by 0x4E3BC6F: opj_jp2_decode (jp2.c:749)
==23383==    by 0x40231A: main (j2k_to_image.c:717)
==23383==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==23383== 
==23383== 
==23383== Process terminating with default action of signal 11 (SIGSEGV)
==23383==  Access not within mapped region at address 0x0
==23383==    at 0x4E42076: t1_decode_cblks (t1.c:1560)
==23383==    by 0x4E49B65: tcd_decode_tile (tcd.c:1383)
==23383==    by 0x4E382B6: j2k_read_eoc (j2k.c:1566)
==23383==    by 0x4E394D8: j2k_decode (j2k.c:1877)
==23383==    by 0x4E3BC6F: opj_jp2_decode (jp2.c:749)
==23383==    by 0x40231A: main (j2k_to_image.c:717)

Reported by sebras on 2012-06-16 02:05:09

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions