Opened 3 months ago
Closed 3 months ago
#11266 closed defect (fixed)
in_tile_headers not reset in jpeg2000_read_main_headers()
Reported by: | Pierre-Anthony Lemieux | Owned by: | |
---|---|---|---|
Priority: | critical | Component: | avcodec |
Version: | git-master | Keywords: | j2k |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | yes |
Description
in_tile_headers is a context variable that is preserved across calls to jpeg2000_read_main_headers(), and thus across frames in a multi-frame file. Once set to 1 it remains equal to 1 forever, even though we might not be in a tile header.
This is an issue since some processing in jpeg2000_read_main_headers() depends on the value of in_tile_headers. In particular, checking whether COD markers are present tile part headers, which is prohibited for homogeneous HT codestreams.
To make a long story short, processing an MXF file that contains HT codestreams will fail on the second frame.
./ffmpeg -i mer_shrt_23976_vdm_sdr_rec709_g24_3840x2160_20170913_12bit_DCDM.4bpp.mxf out.mp4
throws
[jpeg2000 @ 0x55fac474ee00] COD marker found in a tile header but the codestream belongs to the HOMOGENEOUS set [vist#0:0/jpeg2000 @ 0x55fac47400c0] [dec:jpeg2000 @ 0x55fac474e380] Error submitting packet to decoder: Invalid data found when processing input
NOTE: It is not clear why in_tile_headers is a context variable since it looks like it is only used in jpeg2000_read_main_headers().
Sample file at:
Change History (3)
comment:1 by , 3 months ago
comment:2 by , 3 months ago
Analyzed by developer: | set |
---|---|
Reproduced by developer: | set |
Status: | new → open |
comment:3 by , 3 months ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20241025002317.25786-1-pal@sandflow.com/