#11266: in_tile_headers not reset in jpeg2000_read_main_headers()
-------------------------------------+-------------------------------------
             Reporter:  Pierre-      |                     Type:  defect
  Anthony Lemieux                    |
               Status:  new          |                 Priority:  critical
            Component:  avcodec      |                  Version:  git-
                                     |  master
             Keywords:  j2k          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 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
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11266>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to