On Thu, 27 Aug 2015 12:40:30 +0200 lummax <luo...@googlemail.com> wrote:
> Assert on `avctx->codec->encode2` to avoid a SEGFAULT on the subsequent > function call. > --- > libavcodec/utils.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > index 4da16ee..f51070c 100644 > --- a/libavcodec/utils.c > +++ b/libavcodec/utils.c > @@ -1953,6 +1953,8 @@ int attribute_align_arg > avcodec_encode_audio2(AVCodecContext *avctx, > } > } > > + av_assert0(avctx->codec->encode2); > + > ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); > if (!ret) { > if (*got_packet_ptr) { When can this happen? Shouldn't it just return an error somewhere if this is not an encoder? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel