On Sun, Apr 03, 2016 at 04:54:47PM -0400, Derek Buitenhuis wrote: > Modifying global header extradata in encode_frame is an API violation > and only happens to work currently because mov writes its header > at the end of the file. > > Heavily based off of a patch from 2012. > > Original-by: Nicolas George <geo...@nsup.org> > Signed-off-by: Derek Buitenhuis <derek.buitenh...@gmail.com> > --- > libavcodec/libxvid.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c > index 76e725e..e353154 100644 > --- a/libavcodec/libxvid.c > +++ b/libavcodec/libxvid.c > @@ -96,6 +96,9 @@ struct xvid_ff_pass1 { > }; > > static int xvid_encode_close(AVCodecContext *avctx); > +static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, > + const AVFrame *picture, int *got_packet); > + > > /* > * Xvid 2-Pass Kludge Section > @@ -707,6 +710,42 @@ FF_ENABLE_DEPRECATION_WARNINGS > > av_assert0(xvid_enc_create.num_plugins + (!!x->ssim) + > (!!x->variance_aq) + (!!x->lumi_aq) <= FF_ARRAY_ELEMS(plugins)); > > + /* Encode a dummy frame to get the extradata immediately */ > + if (x->quicktime_format) { > + AVFrame *picture; > + AVPacket packet; > + int size, got_packet, ret; > + > + av_init_packet(&packet); > + > + picture = av_frame_alloc(); > + if (!picture) > + return AVERROR(ENOMEM); > + > + xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL);
> + if( xerr ) { > + av_log(avctx, AV_LOG_ERROR, "Xvid: Could not create encoder > reference\n"); > + return AVERROR_EXTERNAL; > + } leaks pictures [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel