[FFmpeg-devel] [PATCH] initialize pkt-> data and pkt->size to NULL and zero

Mike Scheutzow scheutzow
Mon May 3 20:14:37 CEST 2010

Thierry Foucu wrote:
> On Sat, May 1, 2010 at 2:03 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>> Thierry Foucu <tfoucu <at> gmail.com> writes:
>>> Here is the issue I found when debugging a AVI file:
>> Could you upload the sample to ftp://ffmpeg.org/MPlayer/incoming/(write-only)
>> and post the file-name here?
> I wish I could upload the file, but not sure legally i can.
> Is there any reason why the pkt->data and pkt->size are not set when we call
>  av_init_packet ?
> _______________________________________________

The name of this function is misleading. av_init_packet() is not defined 
to do what you might guess based on reading only the name.

 From the documentation in avcodec.h:

	"Initialize optional fields of a packet with default values."

So this function is intended for recycling an already existing AVPacket, 
not for initializing a newly-created one.

Mike Scheutzow

More information about the ffmpeg-devel mailing list