On Wed, Apr 24, 2024 at 01:20:02PM +0200, Jerome Martinez wrote: > Hi, I'm bumping this patch proposal for avoiding a situation where FFmpeg > skips half the visual content when 2 jpeg2000 codestreams are present in one > frame. I re-reviewed this discussion and think I answered all concerns. I'm > hesitant with patch v3 because I consider that touching frame_worker_thread > for this feature is not so useful but I am ok with either patch v2 or v3. > Thanks much, >     Jérôme I hope i applied the correct patch: libavcodec/avcodec.h | 14 ++++++++++++++ libavcodec/codec_par.c | 3 +++ libavcodec/codec_par.h | 5 +++++ libavcodec/decode.c | 3 +++ libavcodec/defs.h | 7 +++++++ libavcodec/jpeg2000dec.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- libavcodec/jpeg2000dec.h | 6 ++++++ libavcodec/pthread_frame.c | 3 +++ libavformat/mxfdec.c | 14 ++++++++++++++ 9 files changed, 118 insertions(+), 10 deletions(-) but that with: ./ffmpeg -i ~/tickets/1102/ntsc2.mxf -bitexact -vframes 1 /tmp/file.bmp segafaults: ==1031087== Invalid write of size 2 ==1031087== at 0x9D758F: jpeg2000_decode_tile (in ffmpeg/ffmpeg_g) ==1031087== by 0x7C3820: avcodec_default_execute2 (in ffmpeg/ffmpeg_g) ==1031087== by 0x9DCE6E: jpeg2000_decode_frame (in ffmpeg/ffmpeg_g) ==1031087== by 0xAF912F: frame_worker_thread (in ffmpeg/ffmpeg_g) ==1031087== by 0x4A00608: start_thread (pthread_create.c:477) ==1031087== by 0x8104352: clone (clone.S:95) ==1031087== Address 0x0 is not stack'd, malloc'd or (recently) free'd [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin