Opened 26 hours ago

Last modified 23 hours ago

#11266 open defect

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:

https://www.sandflow.com/public/mer_shrt_23976_vdm_sdr_rec709_g24_3840x2160_20170913_12bit_DCDM.4bpp.mxf

Change History (2)

comment:2 by Pierre-Anthony Lemieux, 23 hours ago

Analyzed by developer: set
Reproduced by developer: set
Status: newopen
Note: See TracTickets for help on using tickets.