[FFmpeg-devel] [PATCH] 04: dtsdec: fix attempts to decode incomplete frames

Aurelien Jacobs aurel
Thu May 17 19:09:15 CEST 2007


On Thu, 17 May 2007 18:01:43 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> Hi
> 
> On Thu, May 17, 2007 at 03:49:17PM +0200, Benjamin Larsson wrote:
> > Michael Niedermayer wrote:
> > > Hi
> > > 
> > > On Thu, May 17, 2007 at 02:01:22PM +0400, Pavlov Konstantin wrote:
> > >> Hello.
> > >>
> > >> When (!len) is checked in the buffer fill loop in dts_decode_frame(),
> > >> the buffer does not contain a complete frame, therefore executing
> > >> "break" when there is no more input data is not correct (subsequent
> > >> code will try to decode the buffer, which then will lead to garbage
> > >> output and sync loss).  The proper action is to return the number of
> > >> consumed bytes and wait for more data.
> > >>
> > >> The problematic case can be triggered by mplayer - apparently it
> > >> passes the stream to decoder without caring about frame boundaries,
> > >> and sometimes the data block happens to contain just the frame header;
> > >> in this case the first pass through the loop will consume HEADER_SIZE
> > >> bytes from the input data, and the second pass would trigger the bug.
> > > 
> > > libavcodec decoders must always be feeded with complete frames
> > > patch rejected
> > > 
> > > an exception to this is possible _only_ if CODEC_FLAG_TRUNCATED AND
> > > CODEC_CAP_TRUNCATED is set AND the decoder needs 1 pass less over the
> > > data than parser+decoder (=its faster to not split the stream into frames)
> > > 
> > > [...]
> > > 
> > 
> > How about we just svn remove the file instead.
> 
> you have my full support for that ...

We have been talking about this for too long now.
I just dit it !

Aurel




More information about the ffmpeg-devel mailing list