[FFmpeg-devel] avformat/mxfenc: SMPTE RDD 48:2018 Amd 1:2022 (FFV1 in MXF) support

Michael Niedermayer michael at niedermayer.cc
Sat Apr 1 18:43:01 EEST 2023


On Sat, Apr 01, 2023 at 05:20:50PM +0200, Jerome Martinez wrote:
> On 01/04/2023 16:37, Michael Niedermayer wrote:
> > On Tue, Mar 14, 2023 at 10:52:15AM +0100, Jerome Martinez wrote:
> > [...]
> > > +
> > > +    memset(state, 128, sizeof(state));
> > > +    if (st->codecpar->extradata) {
> > > +        ff_init_range_decoder(&c, st->codecpar->extradata, st->codecpar->extradata_size);
> > > +        ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
> > > +        v = get_ffv1_unsigned_symbol(&c, state);
> > > +        av_assert0(v >= 2);
> > > +        if (v > 4) {
> > > +            return 0;
> > > +        }
> > > +        sc->micro_version = get_ffv1_unsigned_symbol(&c, state);
> > > +    } else {
> > > +        uint8_t keystate = 128;
> > > +        ff_init_range_decoder(&c, pkt->data, pkt->size);
> > > +        ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
> > > +        get_rac(&c, &keystate); // keyframe
> > > +        v = get_ffv1_unsigned_symbol(&c, state);
> > > +        av_assert0(v < 2);
> > Are these asserts testing muxer input ?
> > if so what ensures that the values are within the asserted range ?
> 
> 
> My understanding of the code and workflow is that the input is currently
> rejected (AV_LOG_ERROR, "invalid version %d in ver01 header\n" and
> AV_LOG_ERROR, "Invalid version in global header\n") in ffv1dec.c during the
> analysis of this input so before this piece of code is reached.
> Could be an AV_LOG_ERROR if preferred.

if the encoder writes 5 teh muxer crashes here

V 5me=    0 fps=0.0 q=-0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
Assertion v < 2 failed at libavformat/mxfenc.c:2505

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Never trust a computer, one day, it may think you are the virus. -- Compn
-------------- 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/20230401/bb6473be/attachment.sig>


More information about the ffmpeg-devel mailing list