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

Pavlov Konstantin thresh
Thu May 17 19:18:33 CEST 2007


On Thu, May 17, 2007 at 07:09:15PM +0200, Aurelien Jacobs 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 !

Thanks.

fortune(1) is always right, isn't it?

-- 
You will be run over by a beer truck.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070517/7d5f8bf5/attachment.pgp>



More information about the ffmpeg-devel mailing list