[FFmpeg-devel] [PATCH 2/2] avformat/mxfenc: support XAVC long gop

Hendrik Leppkes h.leppkes at gmail.com
Wed Apr 10 02:05:55 EEST 2019

On Wed, Apr 10, 2019 at 12:21 AM Baptiste Coudurier
<baptiste.coudurier at gmail.com> wrote:
> +                return 0;
> +            }
> +            init_get_bits(&gb, tmp, tmp_size*8);
> +            ret = avpriv_h264_decode_seq_parameter_set(&gb, (AVCodecContext*)s, &ps, 0);

The AVCodecContext cast looks like a recipe for disaster. The function
is internal to the H264 decoder, so if it at some point decides to
actually access the AVCodecContext it receives, or even worse, the
priv_data element in it, expecting a H264Context, then everything goes
to hell.
Just another sign why exporting functions internal from a decoder is
just an overall bad idea...

- Hendrik

More information about the ffmpeg-devel mailing list