OpenJPH icon indicating copy to clipboard operation
OpenJPH copied to clipboard

seg fault with HT codestream

Open michaeldsmith opened this issue 3 years ago • 3 comments

I get a seg fault in Ubuntu when using ojph_expand compile from current master branch with the HTJ2K J2C file in the attached zip


root@79f3152c1012:/usr/src/openjph/build# ../bin/ojph_expand -i ht_2160p_10_layers.j2c -o ht_2160p_10_layers.j2c.tif
Segmentation fault

ht_2160p_10_layers.zip

I created this file with Kakadu v.8.2.1 using the following command:

kdu_compress -i 3840x2160_10bit_444_BT709_SDR.tif -o ht_2160p_10_layers.j2c Cmodes=HT -rate 1 Clayers=10 -no_info

michaeldsmith avatar Jul 13 '22 17:07 michaeldsmith

Hi Mike,

Thank you for discovering this bug; I will fix soon.

Kind regards, Aous.

aous72 avatar Jul 14 '22 03:07 aous72

If the seg fault is caused by the presence of placeholder passes, one idea is that you could read the number of layers field in SGcod, and if the value is greater than 1, the decoder could fast fail with a descriptive error message like "codestream contains X quality layers and decoding multiple quality layers is not currently supported"

image

michaeldsmith avatar Jul 14 '22 05:07 michaeldsmith

Thanks Mike. This is a good idea; I should implement it. I also must fix the bug causing the segmentation fault -- it is a bug.

aous72 avatar Jul 14 '22 07:07 aous72