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

Michael Niedermayer michaelni
Thu May 17 18:01:43 CEST 2007


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 ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070517/7d784a4b/attachment.pgp>



More information about the ffmpeg-devel mailing list