[FFmpeg-devel] [PATCH v2] avcodec/jpeg2000dec: support of 2 fields in 1 AVPacket

Michael Niedermayer michael at niedermayer.cc
Thu Apr 25 03:59:21 EEST 2024


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240425/56c8a359/attachment.sig>


More information about the ffmpeg-devel mailing list