[FFmpeg-devel] [PATCH] add av_shrink_packet

Michael Niedermayer michaelni
Wed Apr 8 02:49:40 CEST 2009


On Tue, Apr 07, 2009 at 05:20:01PM -0700, Baptiste Coudurier wrote:
> On 4/7/2009 4:38 PM, Michael Niedermayer wrote:
> > On Wed, Apr 08, 2009 at 12:17:32AM +0200, Reimar D?ffinger wrote:
> >> Hello,
> >> currently av_get_packet upon a partial read simply resizes the packet
> >> by setting pkt->size. Unfortunately like that the padding will not be
> >> set to 0 as required, it can actually be uninitialized.
> >> Attached is a possible solution to this.
> > 
> > not pretty but ok as i ve no better idea either
> > 
> 
> Print and return error in this case ?
> 
> Feeding partial packets might be a good way to test decoder resistance,
> but overall it only produces bug reports and bugs in my experience.

for the raw case the last frame that is partial for the demuxer is not
partial for the decoder, as the demuxer doesnt know the frame sizes
only after the parser are they known ...
also if just 1 byte is missing it would be annoying if the frame would
be thrown away for non raw demuxers

and decoders have to deal with nonsense input anyway, throwing such
away at demuxer level doesnt feel correct to me

maybe we could set some flag in AVPacket to indicate that a packet is
possibly damaged, iam not sure if this would be of any use, but a user
application could at least drop such packets if its author thinks its
better though i dont really think it is ...


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- 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/20090408/ecbe453f/attachment.pgp>



More information about the ffmpeg-devel mailing list