[FFmpeg-devel] [PATCH 2/2] libavcodec/mpegvideo_enc.c: Fix encoding videos with less frames than the delay of the encoder.

Alexis Ballier aballier at gentoo.org
Mon Oct 19 09:20:08 CEST 2015


On Sun, 18 Oct 2015 12:09:48 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> On Fri, Oct 16, 2015 at 10:42:33AM +0200, Alexis Ballier wrote:
> > When the encoder is fed with less frames than its delay, the
> > picture list looks like { NULL, NULL, ..., frame, frame, frame }.
> > When flushing the encoder (input frame == NULL), we need to ensure
> > the picture list is shifted enough so that we do not return an
> > empty packet, which would mean the encoder has finished, while it
> > has not encoded any frame.
> > 
> > Before the patch, the command:
> > './ffmpeg_g -loglevel debug -f lavfi -i "testsrc=d=0.01" -bf 2
> > -vcodec mpeg2video out.mxf' prints:
> > 
> > Output stream #0:0 (video): 1 frames encoded; 0 packets muxed (0
> > bytes);
> > 
> > After:
> > 
> > Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (8058
> > bytes);
> > 
> > Relates to ticket #4817.
> > ---
> >  libavcodec/mpegvideo_enc.c | 16 ++++++++++++----
> >  1 file changed, 12 insertions(+), 4 deletions(-)  
> 
> applied
> 
> thanks
> 
> [...]

thx, but what about patch 1/2 ? the original crash is hidden by this
fix, but mxf muxer can still crash by trying to read and write to
some_array[uint_max]...


More information about the ffmpeg-devel mailing list