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

Michael Niedermayer michaelni
Thu May 17 15:34:35 CEST 2007


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)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- 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/ebee4629/attachment.pgp>

More information about the ffmpeg-devel mailing list