> On Apr 9, 2019, at 4:05 PM, Hendrik Leppkes <[email protected]> wrote: > > On Wed, Apr 10, 2019 at 12:21 AM Baptiste Coudurier > <[email protected]> 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…
Calm down. AVCodecContext can be allocated in any case, for AV_CODEC_ID_H264. The reason that function needs it in the first place is small. Re-using code is _good_ — Baptiste _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
