Neopallium / jpeg2k

Safe wrapper for openjpeg-sys.
MIT License
6 stars 7 forks source link

Reading only part of a progressive JPEG 2000 #1

Open John-Nagle opened 2 years ago

John-Nagle commented 2 years ago

OpenJPEG can give me the header info with the image size, and then I can ask for a fraction of the resolution without reading the entire stream. But I don't think you expose that functionality. Is there some way to do that?

Use case is wanting a low-rez version from the asset server for Open Simulator or Second Life. Often, many assets are only read at low-rez because they are for distant objects. So the network connection only reads part of the data and then is closed.

(Current code is running OpenJPEG in a subprocess, and reading too much. Looks like this: https://player.vimeo.com/video/640175119)

John-Nagle commented 1 year ago

I moved up to jpeg2k 6.0.3. Same errors.

Will try running the tests without cargo next.

Neopallium commented 1 year ago

Ok. Just making sure that we are using the same versions. I finally got a crash using the uuid list you sent me.

John-Nagle commented 1 year ago

Oh, good, you can reproduce the bug.

John-Nagle commented 1 year ago

Is there anything else I should do now? Or do you have enough information to work on the problem?

Neopallium commented 1 year ago

Not a crash, but valgrind did split out this error:

Reduction ratio: 8, discard level 3, bytes to read = 44236
==1716272== Thread 2 decode::fetch_m:
==1716272== Conditional jump or move depends on uninitialised value(s)
==1716272==    at 0x448C26: opj_t2_read_packet_header (t2.c:1156)
==1716272==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716272==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716272==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716272==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716272==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716272==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716272==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716272==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716272==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716272==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716272==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716272==
==1716272== Conditional jump or move depends on uninitialised value(s)
==1716272==    at 0x41AA60: opj_bio_inalign (bio.c:210)
==1716272==    by 0x448C37: opj_t2_read_packet_header (t2.c:1158)
==1716272==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716272==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716272==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716272==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716272==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716272==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716272==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716272==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716272==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716272==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716272==
==1716272== Conditional jump or move depends on uninitialised value(s)
==1716272==    at 0x448C26: opj_t2_read_packet_header (t2.c:1156)
==1716272==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716272==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716272==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716272==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716272==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716272==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716272==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716272==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716272==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716272==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716272==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716272==
==1716272== Conditional jump or move depends on uninitialised value(s)
==1716272==    at 0x41AA60: opj_bio_inalign (bio.c:210)
==1716272==    by 0x448C37: opj_t2_read_packet_header (t2.c:1158)
==1716272==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716272==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716272==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716272==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716272==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716272==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716272==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716272==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716272==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716272==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716272==

Asset texture_id=0d316653-ab16-411f-65ef-a1063302e093
Image stats: Some(ImageStats { bytes_per_pixel: 3, dimensions: (1024, 1024) })
Reduction ratio: 8, discard level 3, bytes to read = 44236
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x448E58: opj_t2_read_packet_header (t2.c:1216)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446C0D: opj_t2_getnumpasses (t2.c:202)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446B17: opj_t2_getcommacode (t2.c:178)
==1716460==    by 0x448F25: opj_t2_read_packet_header (t2.c:1238)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4493A3: opj_t2_read_packet_header (t2.c:1303)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x448E4A: opj_t2_read_packet_header (t2.c:1212)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C26: opj_t2_getnumpasses (t2.c:205)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446C29: opj_t2_getnumpasses (t2.c:205)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4193AA: opj_tgt_decode (tgt.c:330)
==1716460==    by 0x448E31: opj_t2_read_packet_header (t2.c:1208)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446C4A: opj_t2_getnumpasses (t2.c:208)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446B14: opj_t2_getcommacode (t2.c:178)
==1716460==    by 0x448F25: opj_t2_read_packet_header (t2.c:1238)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446A92: opj_uint_floorlog2 (opj_intmath.h:240)
==1716460==    by 0x44932E: opj_t2_read_packet_header (t2.c:1294)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449441: opj_t2_read_packet_header (t2.c:1309)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4494A9: opj_t2_read_packet_header (t2.c:1317)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4193A7: opj_tgt_decode (tgt.c:330)
==1716460==    by 0x448E31: opj_t2_read_packet_header (t2.c:1208)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41AA60: opj_bio_inalign (bio.c:210)
==1716460==    by 0x4494FA: opj_t2_read_packet_header (t2.c:1323)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449D62: opj_t2_skip_packet_data (t2.c:1580)
==1716460==    by 0x4487F0: opj_t2_skip_packet (t2.c:1035)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449D76: opj_t2_skip_packet_data (t2.c:1580)
==1716460==    by 0x4487F0: opj_t2_skip_packet (t2.c:1035)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449CC7: opj_t2_skip_packet_data (t2.c:1560)
==1716460==    by 0x4487F0: opj_t2_skip_packet (t2.c:1035)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449EAF: opj_t2_skip_packet_data (t2.c:1622)
==1716460==    by 0x4487F0: opj_t2_skip_packet (t2.c:1035)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449ED0: opj_t2_skip_packet_data (t2.c:1626)
==1716460==    by 0x4487F0: opj_t2_skip_packet (t2.c:1035)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x448BF4: opj_t2_read_packet_header (t2.c:1154)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x448BF4: opj_t2_read_packet_header (t2.c:1154)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)

Asset texture_id=11e847b2-3901-41a6-5b36-e3236476aee8
Image stats: Some(ImageStats { bytes_per_pixel: 4, dimensions: (512, 512) })
Reduction ratio: 4, discard level 2, bytes to read = 58982
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x448E58: opj_t2_read_packet_header (t2.c:1216)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446C0D: opj_t2_getnumpasses (t2.c:202)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446B17: opj_t2_getcommacode (t2.c:178)
==1716460==    by 0x448F25: opj_t2_read_packet_header (t2.c:1238)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41AA60: opj_bio_inalign (bio.c:210)
==1716460==    by 0x4494FA: opj_t2_read_packet_header (t2.c:1323)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x449883: opj_t2_read_packet_data (t2.c:1426)
==1716460==    by 0x447AC8: opj_t2_decode_packet (t2.c:649)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4498A3: opj_t2_read_packet_data (t2.c:1427)
==1716460==    by 0x447AC8: opj_t2_decode_packet (t2.c:649)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==    by 0x3DAB14: jpeg2k::j2k_image::Image::from_stream (j2k_image.rs:165)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446B14: opj_t2_getcommacode (t2.c:178)
==1716460==    by 0x448F25: opj_t2_read_packet_header (t2.c:1238)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446B14: opj_t2_getcommacode (t2.c:178)
==1716460==    by 0x448F25: opj_t2_read_packet_header (t2.c:1238)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4493A3: opj_t2_read_packet_header (t2.c:1303)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4493A3: opj_t2_read_packet_header (t2.c:1303)
==1716460==    by 0x447A6D: opj_t2_decode_packet (t2.c:636)
==1716460==    by 0x447780: opj_t2_decode_packets (t2.c:510)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C26: opj_t2_getnumpasses (t2.c:205)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C26: opj_t2_getnumpasses (t2.c:205)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x448E4A: opj_t2_read_packet_header (t2.c:1212)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x448E4A: opj_t2_read_packet_header (t2.c:1212)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4193AA: opj_tgt_decode (tgt.c:330)
==1716460==    by 0x448ED0: opj_t2_read_packet_header (t2.c:1227)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C0A: opj_t2_getnumpasses (t2.c:202)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C0A: opj_t2_getnumpasses (t2.c:202)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C0A: opj_t2_getnumpasses (t2.c:202)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4193A7: opj_tgt_decode (tgt.c:330)
==1716460==    by 0x448E31: opj_t2_read_packet_header (t2.c:1208)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x4193A7: opj_tgt_decode (tgt.c:330)
==1716460==    by 0x448E31: opj_t2_read_packet_header (t2.c:1208)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C64: opj_t2_getnumpasses (t2.c:211)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C64: opj_t2_getnumpasses (t2.c:211)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C64: opj_t2_getnumpasses (t2.c:211)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x446C6C: opj_t2_getnumpasses (t2.c:211)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A6DD: opj_bio_bytein (bio.c:95)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C42: opj_t2_getnumpasses (t2.c:208)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x41A708: opj_bio_bytein (bio.c:96)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C42: opj_t2_getnumpasses (t2.c:208)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x41A725: opj_bio_bytein (bio.c:99)
==1716460==    by 0x41A7C6: opj_bio_getbit (bio.c:116)
==1716460==    by 0x41A9D2: opj_bio_read (bio.c:189)
==1716460==    by 0x446C42: opj_t2_getnumpasses (t2.c:208)
==1716460==    by 0x448F12: opj_t2_read_packet_header (t2.c:1237)
==1716460==    by 0x448794: opj_t2_skip_packet (t2.c:1022)
==1716460==    by 0x44782F: opj_t2_decode_packets (t2.c:522)
==1716460==    by 0x416851: opj_tcd_t2_decode (tcd.c:1956)
==1716460==    by 0x415DC4: opj_tcd_decode_tile (tcd.c:1645)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4453F5: opj_t1_decode_cblk (t1.c:2024)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==    by 0x3D1D93: jpeg2k::codec::Decoder::decode (codec.rs:522)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x3E8252: opj_realloc (opj_malloc.c:241)
==1716460==    by 0x445414: opj_t1_decode_cblk (t1.c:2025)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x483B6D0: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x483E017: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x3E826D: opj_realloc (opj_malloc.c:244)
==1716460==    by 0x445414: opj_t1_decode_cblk (t1.c:2025)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x48428EC: memset (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x44545B: opj_t1_decode_cblk (t1.c:2031)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4842909: memset (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x44545B: opj_t1_decode_cblk (t1.c:2031)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x48429FA: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842BA1: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B0E: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B3F: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B55: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4842B60: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4842B63: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B6E: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4521B1: opj_mqc_init_dec_common (mqc.c:434)
==1716460==    by 0x45220F: opj_mqc_init_dec (mqc.c:447)
==1716460==    by 0x4455F2: opj_t1_decode_cblk (t1.c:2068)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4521BF: opj_mqc_init_dec_common (mqc.c:435)
==1716460==    by 0x45220F: opj_mqc_init_dec (mqc.c:447)
==1716460==    by 0x4455F2: opj_t1_decode_cblk (t1.c:2068)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4521CE: opj_mqc_init_dec_common (mqc.c:436)
==1716460==    by 0x45220F: opj_mqc_init_dec (mqc.c:447)
==1716460==    by 0x4455F2: opj_t1_decode_cblk (t1.c:2068)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x452232: opj_mqc_init_dec (mqc.c:450)
==1716460==    by 0x4455F2: opj_t1_decode_cblk (t1.c:2068)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4330A3: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x433353: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43360F: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x432E0E: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x433682: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4522FF: opq_mqc_finish_dec (mqc.c:475)
==1716460==    by 0x445740: opj_t1_decode_cblk (t1.c:2107)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x483DF65: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x3E826D: opj_realloc (opj_malloc.c:244)
==1716460==    by 0x445414: opj_t1_decode_cblk (t1.c:2025)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842A11: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B8B: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842A20: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4842B08: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4333C6: opj_t1_dec_refpass_mqc_generic (t1.c:1031)
==1716460==    by 0x433A0D: opj_t1_dec_refpass_mqc (t1.c:1041)
==1716460==    by 0x445681: opj_t1_decode_cblk (t1.c:2087)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43CF64: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43F6F8: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43FC9F: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43EB51: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43F156: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43CFDA: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43D1B6: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43D40D: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43E287: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x43E576: opj_t1_dec_clnpass_generic_novsc (t1.c:1379)
==1716460==    by 0x44392E: opj_t1_dec_clnpass (t1.c:1406)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4842B30: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Use of uninitialised value of size 8
==1716460==    at 0x4842B33: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==1716460==    by 0x4454CE: opj_t1_decode_cblk (t1.c:2039)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==    by 0x3E7CA7: opj_decode (openjpeg.c:521)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x438D14: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4365BC: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x438772: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x438182: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460==
==1716460== More than 100 errors detected.  Subsequent errors
==1716460== will still be recorded, but in less detail than before.
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4392BB: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x4387E8: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)
==1716460==
==1716460== Conditional jump or move depends on uninitialised value(s)
==1716460==    at 0x438A0D: opj_t1_dec_clnpass_64x64_novsc (t1.c:1365)
==1716460==    by 0x4438FE: opj_t1_dec_clnpass (t1.c:1400)
==1716460==    by 0x445697: opj_t1_decode_cblk (t1.c:2091)
==1716460==    by 0x444356: opj_t1_clbl_decode_processor (t1.c:1704)
==1716460==    by 0x41A196: opj_thread_pool_submit_job (thread.c:835)
==1716460==    by 0x4451A3: opj_t1_decode_cblks (t1.c:1943)
==1716460==    by 0x416974: opj_tcd_t1_decode (tcd.c:2000)
==1716460==    by 0x415DEB: opj_tcd_decode_tile (tcd.c:1654)
==1716460==    by 0x3FB358: opj_j2k_decode_tile (j2k.c:9862)
==1716460==    by 0x3FFCE6: opj_j2k_decode_tiles (j2k.c:11664)
==1716460==    by 0x3F9343: opj_j2k_exec (j2k.c:9006)
==1716460==    by 0x400ADD: opj_j2k_decode (j2k.c:12010)

Reading uninitialized memory might be why it randomly crashes.

John-Nagle commented 1 year ago

t2.c, line 1150, looks suspicious.

l_remaining_length = (OPJ_UINT32)(p_src_data + p_max_length - l_header_data);

I'm not sure what's going on in that code, but it seems to me that there should be some kind of check there for going off the end of the input data. Since I'm submitting truncated files to the decoder, that's a likely cause of trouble.

Neopallium commented 1 year ago

I am adding caching (dumping to files) of the data passed in for decoding, which might help with getting a test-case.

Neopallium commented 1 year ago

Finally got opj_decompress to also get the same errors from valgrind:

rm -f test.png; OPJ_NUM_THREADS=1 valgrind opj_decompress -allow-partial -i ./bad/36b68663-b68d-9923-bf
10-0c55c52426b5_0_44236.j2k -o test.png -r 2
==1725489== Memcheck, a memory error detector
==1725489== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1725489== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==1725489== Command: opj_decompress -allow-partial -i ./bad/36b68663-b68d-9923-bf10-0c55c52426b5_0_44236.j2k -o test.png -r 2
==1725489==

[INFO] Start to read j2k main header (0).
[INFO] Main header has been correctly decoded.
[INFO] No decoded area parameters, set the decoded area to the whole image
[WARNING] Tile part length size inconsistent with stream length
[INFO] Stream reached its end !
[INFO] Header of tile 1 / 1 has been read.
[WARNING] skip: segment too long (74) with max (3332) for codeblock 2 (p=0, b=1, r=4, c=1)
[WARNING] skip: segment too long (137) with max (3332) for codeblock 3 (p=0, b=1, r=4, c=1)
[WARNING] skip: segment too long (65) with max (3332) for codeblock 0 (p=0, b=2, r=4, c=1)
[WARNING] skip: segment too long (92) with max (3332) for codeblock 1 (p=0, b=2, r=4, c=1)
[WARNING] skip: segment too long (93) with max (3332) for codeblock 2 (p=0, b=2, r=4, c=1)
[WARNING] skip: segment too long (151) with max (3332) for codeblock 3 (p=0, b=2, r=4, c=1)
==1725489== Conditional jump or move depends on uninitialised value(s)
==1725489==    at 0x48FAAB6: opj_t2_read_packet_header (t2.c:1156)
==1725489==    by 0x48FA624: opj_t2_skip_packet (t2.c:1022)
==1725489==    by 0x48F96BF: opj_t2_decode_packets (t2.c:522)
==1725489==    by 0x4900F1B: opj_tcd_t2_decode (tcd.c:1956)
==1725489==    by 0x490048E: opj_tcd_decode_tile (tcd.c:1645)
==1725489==    by 0x48C09E7: opj_j2k_decode_tile (j2k.c:9862)
==1725489==    by 0x48C5375: opj_j2k_decode_tiles (j2k.c:11664)
==1725489==    by 0x48BE9D2: opj_j2k_exec (j2k.c:9006)
==1725489==    by 0x48C616C: opj_j2k_decode (j2k.c:12010)
==1725489==    by 0x48D27CC: opj_decode (openjpeg.c:521)
==1725489==    by 0x110456: main (opj_decompress.c:1582)
==1725489==
==1725489== Conditional jump or move depends on uninitialised value(s)
==1725489==    at 0x489830D: opj_bio_inalign (bio.c:210)
==1725489==    by 0x48FAAC7: opj_t2_read_packet_header (t2.c:1158)
==1725489==    by 0x48FA624: opj_t2_skip_packet (t2.c:1022)
==1725489==    by 0x48F96BF: opj_t2_decode_packets (t2.c:522)
==1725489==    by 0x4900F1B: opj_tcd_t2_decode (tcd.c:1956)
==1725489==    by 0x490048E: opj_tcd_decode_tile (tcd.c:1645)
==1725489==    by 0x48C09E7: opj_j2k_decode_tile (j2k.c:9862)
==1725489==    by 0x48C5375: opj_j2k_decode_tiles (j2k.c:11664)
==1725489==    by 0x48BE9D2: opj_j2k_exec (j2k.c:9006)
==1725489==    by 0x48C616C: opj_j2k_decode (j2k.c:12010)
==1725489==    by 0x48D27CC: opj_decode (openjpeg.c:521)
==1725489==    by 0x110456: main (opj_decompress.c:1582)
==1725489==
[INFO] Generated Outfile test.png
decode time: 263 ms
==1725489==

It seems related to the reduction level and a partial j2k image.

John-Nagle commented 1 year ago

Thank you. That makes it clear that it's not in your code or my code.

What do we do now?

Neopallium commented 1 year ago

Those uninitialized reads could cause other random issues depending on what value was in memory before.

With caching of the fetched asset data I got crashes at the same spot:

Asset url: http://asset-cdn.glb.agni.lindenlab.com/?texture_id=36b68663-b68d-9923-bf10-0c55c52426b5
Image stats: Some(ImageStats { bytes_per_pixel: 3, dimensions: (512, 512) })
Reduction ratio: 4, discard level 2, bytes to read = 44236
thread 'decode::fetch_multiple_textures_serial' panicked at 'Fetch failed: Jpeg(CodecError("Failed to decode image"))', src/bin/jpeg2000_decoder/decode.rs:377:57
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test decode::fetch_multiple_textures_serial ... FAILED

Here is the change I used to cache the asset files: https://github.com/Neopallium/jpeg2000-decoder/tree/cache_assets

John-Nagle commented 1 year ago

This may be the same problem as https://github.com/uclouvain/openjpeg/issues/1427

Neopallium commented 1 year ago

To generate the that test-case:

wget -O full_image.j2k http://asset-cdn.glb.agni.lindenlab.com/?texture_id=36b68663-b68d-9923-bf10-0c55c52426b5
dd if=./full_image.j2k of=partial_0_44236.j2k bs=44237 count=1

Edit: Here is the command to trigger the uninitialized reads:

OPJ_NUM_THREADS=1 valgrind opj_decompress -allow-partial -i ./partial_0_44236.j2k -o test.png -r 2

Note that the file is 44237 bytes long (http range requests are inclusive on both ends).

Neopallium commented 1 year ago

This may be the same problem as https://github.com/uclouvain/openjpeg/issues/1427

I think that is the same as the issue that requires that we disable thread support.

Edit: Maybe not, since the file size is much smaller and doesn't crash or show any errors from valgrind.

This last test-case seems to be related to partial images and reduction level.

Neopallium commented 1 year ago

I am thinking of sandboxing openjpeg-sys by compiling it to wasm and wrapping that in an easy to use API. Most likely just for decoding and only support getting some metadata and image pixels.

John-Nagle commented 1 year ago

Converting OpenJPEG to compile to WASM would take some effort. WASM is not a supported target for OpenJPEG.

You previously mentioned that you were converting OpenJPEG to Rust. That seems more likely to be useful.

As I understand it, JPEG 2000 files have this structure.

One way to approach this might be to write, in Rust, the parts which parse the stream into its components. Each subsection would be passed to the next level down as a slice. When a slice of "body data" is extracted, that would go to the existing decoder code. The body data decoding code could be the existing C code from OpenJPEG. Or it could be that decoder code translated with c2rust.

Someone else already did most of that top-down work. See https://github.com/iszak/jpeg2000

But they never did the low-level code that does the actual decoding of the compressed image.

Neopallium commented 1 year ago

Converting OpenJPEG to compile to WASM would take some effort. WASM is not a supported target for OpenJPEG.

openjpeg-sys can be compiled to a WASI module (using the wasi-sdk see rebuild-wasi-decoder.sh) and that can be used to run it in a sandbox. It would be nice if OpenJpeg had compile flags to disable the use of stdio (no read/write of files) and disable it's clock wrapper (only used for benchmarking I think), then it could be compiled to a pure WASM module. WASM engines like wasmtime have support for sandboxing WASI modules (restricts file access).

I have created a sandbox wrapper for the jpeg2k decoding: https://github.com/Neopallium/jpeg2k-sandboxed

The Sandboxed decoder object can be shared across threads. Right now each image decode request will instantiate the wasm module (just allocates memory/stack space). It is possible to improve that by making each instance re-usable, but for this first release I just wanted to get it working.

You previously mentioned that you were converting OpenJPEG to Rust. That seems more likely to be useful.

That is a long-term ongoing project. The sandbox wrapper is just a useful short-term solution, it should provide better performance then spawning a process while still protecting the application from crashes.

One way to approach this might be to write, in Rust, the parts which parse the stream into its components. Each subsection would be passed to the next level down as a slice. When a slice of "body data" is extracted, that would go to the existing decoder code. The body data decoding code could be the existing C code from OpenJPEG. Or it could be that decoder code translated with c2rust.

Someone else already did most of that top-down work. See https://github.com/iszak/jpeg2000

But they never did the low-level code that does the actual decoding of the compressed image.

I remember looking at that project when I first started looking for a Jpeg2000 decoder in Rust.

The reason I have started from porting most of OpenJpeg (just the libopenjp2 part) to Rust using c2rust is that I wanted to verify my changes using the OpenJpeg testsuite. Also I haven't had to spend any time reading the Jpeg2000 specs.

Most of the rewrite work that I have already done are to some of the low-level parts (t1, mqc, dwt). Since it was easier to just re-factor the internal unsafe code. Still a lot more cleanup to do, but if I keep working on those low-level parts, then they might be reusable in jpeg2000. Once those sub-modules become usable, they can be split out into crates that both projects can use.

Next time I decide to work on the port, I will check that repo and see what parts might be useable there and focus my effort there.

John-Nagle commented 1 year ago

Thanks very much. I've been running it on the same set of 510 files, with the same file truncation to get a 128x128 file, with no failures. Works in debug, release, and cross-compiled from Linux to x86_64-pc-windows-gnu.

The sandbox wrapper is a good working solution for now. 510 images decoded down to 128x128 in 29 seconds.

If I ask for too much "reduction", I still get "Null pointer from openjpeg-sys". At that point, is the instance of the decoder corrupted? Or can I use it again?

Neopallium commented 1 year ago

It can be used again.

The decoder object Jpeg2kSandboxed only holds the immutable parts (wasm code, Jitted machine code). Each call to decoder.decode() allocates a new instance of the wasm module (memory/stack space). Even if OpenJpeg corrupts the stack/memory that is isolated to the instance and it is safe to keep using the Jpeg2kSandboxed object.

Each decode() call is just like spawning a new process. That is most likely why it is giving stable results, doesn't reuse memory so the uninitialized reads are getting the same value.

Internally wasmtime might be keeping a pool of Store objects that hold the mutable parts (memory/stack), but I am sure that is zero-fills those before reusing (for security, no data leaks between instances). The overhead of creating a new instance (wasm module instance, not decoder object) is mostly just allocating the Store object for the memory/stack.

John-Nagle commented 1 year ago

Thanks.

I'm impressed by how fast this is. The JPEG decoder is doing much low-level bit-pushing yet still runs at acceptable speed.

John-Nagle commented 1 year ago

Benchmarking - decoding 510 images.

OpenJPEG, running in C:

>  cargo test fetch_multiple_textures_serial --release
    Finished release [optimized] target(s) in 0.05s
    Running unittests src/bin/jpeg2000_decoder/main.rs (target/release/deps/jpeg2000_decoder-e69765b3f3ec9074)
running 1 test
test decode::fetch_multiple_textures_serial ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 11.14s

Running in sandbox:

>  cargo test fetch_multiple_textures_serial --release
    Finished release [optimized] target(s) in 0.12s
     Running unittests src/lib/lib.rs (target/release/deps/jpeg2000_decoder-dd2116bab7e93032)
running 1 test
test decode::fetch_multiple_textures_serial ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 29.94s

So, 2.6x slower when sandboxed.

But, if I rerun the C version a few times:

> cargo test fetch_multiple_textures_serial --release
    Finished release [optimized] target(s) in 0.05s
    Running unittests src/bin/jpeg2000_decoder/main.rs (target/release/deps/jpeg2000_decoder-e69765b3f3ec9074)
running 1 test
error: test failed, to rerun pass `--bin jpeg2000_decoder`

Caused by:
  process didn't exit successfully: `/home/john/projects/rustcode/jpeg2000-decoder/target/release/deps/jpeg2000_decoder-e69765b3f3ec9074 fetch_multiple_textures_serial` (signal: 11, SIGSEGV: invalid memory reference)
Neopallium commented 1 year ago

Nice to see some benchmarks of the sandbox.

I should be able to lower the overhead of the sandbox by make the instances reusable (but recreate them if decoding fails, to clear out any corruption from the instance's memory).

The difference in speed might not be as noticeable if the images are processed in parallel. Should be easy to parallelize the benchmark using rayon.

I just got my Rust port of openjpeg to compile correctly for 32bit targets (like wasm32-wasi). I don't expect it to be faster, but now jpeg2k has two OpenJpeg backends (openjpeg-sys and openjp2). The c2rust port still requires the nightly Rust compiler, so for some use-cases it will not be an option until I rewrite the parts the need nightly features (bitfields).

If you want to try it:

jpeg2k = { version = ">=0.6.4", default-features = false, features = ["strict-mode", "openjp2", "image"] }
John-Nagle commented 1 year ago

Thanks.

I intend to process images in parallel. My real graphics program has multiple threads downloading and decompressing, until all CPUs are busy. This runs at a lower priority than rendering, etc. so I can use all available compute power. The program you are seeing is the test fixture only.

I will take a look at the all-Rust form.

John-Nagle commented 1 year ago
> cargo +nightly test
...(many files converted successfully, then)...

Asset url: http://asset-cdn.glb.agni.lindenlab.com/?texture_id=6e75b2fa-83c4-8424-8964-5b176c30f7f0
Image stats: Some(ImageStats { bytes_per_pixel: 3, dimensions: (1024, 1024) })
Reduction ratio: 8, discard level 3, bytes to read = 44236
thread 'decode::fetch_multiple_textures_serial' panicked at 'Fetch failed: Jpeg(CodecError("Failed to decode image"))', src/bin/jpeg2000_decoder/decode.rs:338:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
    decode::fetch_multiple_textures_serial

test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 22.99s

Well, the c2rust version is compatible with the C version. It has the same bug.

John-Nagle commented 1 year ago

Tried

cargo +nightly test fetch_multiple_textures_serial --release

on the c2rust version. Fails on the 510 file test about 2 out of 3 times. Sometimes it succeeds:

running 1 test
test decode::fetch_multiple_textures_serial ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 23.72s

This compares to 12 seconds for the C version and 29 seconds for the WASM version.

One time I got:

 Running unittests src/bin/jpeg2000_decoder/main.rs (target/release/deps/jpeg2000_decoder-006775affacd268b)
running 1 test
error: test failed, to rerun pass `--bin jpeg2000_decoder`
Caused by:
  process didn't exit successfully: `/home/john/projects/jpeg2000-decoder/target/release/deps/jpeg2000_decoder-006775affacd268b fetch_multiple_textures_serial` (signal: 11, SIGSEGV: invalid memory reference)

c2rust correctly reproduced the invalid memory reference in the C code!

If you want to try this, it's branch "c2rusttest" in the same project.

(Current branches: "main": uses C version. "sandbox": uses WASM version. "c2rusttest": uses c2rust version.)

Neopallium commented 1 year ago

c2rust correctly reproduced the invalid memory reference in the C code!

Yup, I don't expect it to fix those bugs yet. But it is nice to be able to switch between the two.

If you want to try this, it's branch "c2rusttest" in the same project.

(Current branches: "main": uses C version. "sandbox": uses WASM version. "c2rusttest": uses c2rust version.)

Thanks that will be useful for comparing performance.

John-Nagle commented 1 year ago

Progress!

Fixed in OpenJPEG (probably). I built OpenJPEG from source and tried the single file test case with the truncated file. Valgrind was happy. But I haven't tried the full 510 file set yet, because that tester is in Rust.

Fix at OpenJPEG level: https://github.com/uclouvain/openjpeg/issues/1459

Version update requested to openjpeg-sys: https://github.com/kornelski/openjpeg-sys/issues/10

Once they do that, you can update, and, with luck, it will work.

Neopallium commented 1 year ago

@John-Nagle I just added support for reading just the image header. This might be useful for you to grab the image details (width, height, # components), before calculating a reduction level.

in jpeg2k I added to examples to benchmark decode/read_header: https://github.com/Neopallium/jpeg2k/blob/main/examples/bench_decode.rs https://github.com/Neopallium/jpeg2k/blob/main/examples/bench_read_header.rs

Also in the sandbox crate I made the same for benchmarking read_header: https://github.com/Neopallium/jpeg2k-sandboxed/blob/main/examples/bench_read_header.rs

For the sandbox requests there is a only_header flag that can be set to true before calling the decode method.

Reading just the header is fast even with the sandbox:

/usr/bin/time -p target/release/examples/bench_read_header ../jpeg2k/tests/partial/test_1024.jp2 0 0 5000
Read file: ../jpeg2k/tests/partial/test_1024.jp2
Total components: 20000
real 0.72
user 1.15
sys 0.24

5,000 header reads in less then a second. That was with rayon disabled.

One thing I noticed is that OpenJpeg's thread support doesn't work well with rayon. Most likely it is using a shared thread pool, or there is some mutex locking. If you use jpeg2k from multiple thread, might be best to make sure threads not enabled for jpeg2k/openjpeg-sys.

John-Nagle commented 1 year ago

Oh, nice. Reading the header by itself is very useful. The info I need is the size of the original image and the info needed to calculate bytes per pixel (number of components and precision) so I can calculate the reduction factor before decoding.

So now I can just:

   if desired size is greater than 16 x 16 
       Read header. Calc amount of data to download for desired size. Download. Decode JPEG
   else
       Download 1K bytes. Decode JPEG

How many bytes are needed to just get that header info? Does it vary with the amount of metadata? Would I ever need more than 1K?

I have threading disabled at the decoder level. I have multiple threads doing download-decode-update cache-etc on multiple images in parallel. These images are mostly too small for within-image threading to help much, if at all. Parallel Open JPEG is for zooming in and out on huge multi-gigabyte images.

John-Nagle commented 1 year ago

New version passed 510 file test.

New version passed Valgrind:


> valgrind ./jpeg2000_decoder-eaa6a064fb95a2a6
==1484783== Memcheck, a memory error detector
==1484783== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1484783== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1484783== Command: ./jpeg2000_decoder-eaa6a064fb95a2a6
==1484783== 

running 5 tests
test decode::test_calc_discard_level ... ok
test decode::test_estimate_read_size ... ok
test fetch::test_fetch_asset ... ok
test decode::fetch_test_texture ... ok
test decode::fetch_multiple_textures_serial has been running for over 60 seconds
test decode::fetch_multiple_textures_serial ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 550.55s

==1484783== 
==1484783== HEAP SUMMARY:
==1484783==     in use at exit: 104,185 bytes in 287 blocks
==1484783==   total heap usage: 854,935 allocs, 854,648 frees, 2,634,822,160 bytes allocated
==1484783== 
==1484783== LEAK SUMMARY:
==1484783==    definitely lost: 0 bytes in 0 blocks
==1484783==    indirectly lost: 0 bytes in 0 blocks
==1484783==      possibly lost: 25,104 bytes in 1 blocks
==1484783==    still reachable: 79,081 bytes in 286 blocks
==1484783==         suppressed: 0 bytes in 0 blocks
==1484783== Rerun with --leak-check=full to see details of leaked memory
==1484783== 
==1484783== For lists of detected and suppressed errors, rerun with: -s
==1484783== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Neopallium commented 1 year ago

Oh, nice. Reading the header by itself is very useful. The info I need is the size of the original image and the info needed to calculate bytes per pixel (number of components and precision) so I can calculate the reduction factor before decoding.

It looks like some details of the components are also decoded from the header. I see precision is decoded.

How many bytes are needed to just get that header info? Does it vary with the amount of metadata? Would I ever need more than 1K?

The dump_jp2 example can be used for testing header decoding of partial files, it will first try to read the header and dump details before trying to decode the image.

You can use j2k_detect_format() to check if the bytes are JP2 file format or J2K codestram format. For JP2 more bytes might be needed depending on how much extra metadata is included in the file. Note the j2k_detect_format function only needs the first 12 bytes.

For the J2K codestream format, I was able to decode the header with just 123 bytes:

❯ xxd test_123.j2c
00000000: ff4f ff51 002f 0000 0000 0080 0000 0080  .O.Q./..........
00000010: 0000 0000 0000 0000 0000 0080 0000 0080  ................
00000020: 0000 0000 0000 0000 0003 0701 0107 0101  ................
00000030: 0701 01ff 5200 0c00 0000 0301 0504 0400  ....R...........
00000040: 00ff 5c00 2322 771e 7700 7700 76e2 6f00  ..\.#"w.w.w.v.o.
00000050: 6f00 6ee2 674c 674c 6764 5003 5003 5045  o.n.gLgLgdP.P.PE
00000060: 57d2 57d2 5761 ff64 0011 0001 4b61 6b61  W.W.Wa.d....Kaka
00000070: 6475 2d76 342e 322e 31ff 90              du-v4.2.1..

Part of that looks to include the name of the software that encoded the image Kakadu-v4.2.1. OpenJpeg uses a longer name Created by OpenJpeg version 2.4.0, so the required number of bytes to read the header is higher.

Openjpeg re-encode of test image (127 bytes):

xxd test_openjpeg_127.j2c | less
00000000: ff4f ff51 002f 0000 0000 0080 0000 0080  .O.Q./..........
00000010: 0000 0000 0000 0000 0000 0080 0000 0080  ................
00000020: 0000 0000 0000 0000 0003 0701 0107 0101  ................
00000030: 0701 01ff 5200 0c00 0000 0100 0504 0400  ....R...........
00000040: 01ff 5c00 1340 4048 4850 4848 5048 4850  ..\..@@HHPHHPHHP
00000050: 4848 5048 4850 ff64 0025 0001 4372 6561  HHPHHP.d.%..Crea
00000060: 7465 6420 6279 204f 7065 6e4a 5045 4720  ted by OpenJPEG
00000070: 7665 7273 696f 6e20 322e 342e 30ff 90    version 2.4.0..

It might be possible to improve header decoding from a partial stream, since it seem that the "comment" field used by encoders is the last part. At least for J2k codestream format. The JP2 file format most likely need more bytes.

With HTTP request pipelining (or HTTP/3?) support on the server, it should be possible to batch small requests (200-300 bytes) to decode the headers.

I might look into adding a simple pure Rust header decoder to jpeg2k.

John-Nagle commented 1 year ago

I see precision is decoded.

Ah, good. Can I read the component info from the header? The last time I looked, the API let me get num_components but I couldn't access the component headers themselves. This is for file size estimation; I need to know how much space each pixel consumes.

Anyway, now I have a usable decoder. Thanks.

Neopallium commented 1 year ago

Ah, good. Can I read the component info from the header? The last time I looked, the API let me get num_components but I couldn't access the component headers themselves. This is for file size estimation; I need to know how much space each pixel consumes.

Let me know if you find a file that is missing the component headers. When only reading the header (or one short partials) the component pixel data will be null, but the other fields seem to be initialized correctly.

I added component info to jpeg2k-sandboxed. Just the width, height, precision, is_alpha fields. Component width/height seem to always be the same as the image width/height, not sure if there is a case where they will not be the same.