title: How to new & delete AVPacket?
body: <p>I'm working with a FFmpeg project right now, I have to store the data of <code>AVPacket</code> which from <code>av_read_frame</code>, and fill data to new <code>AVPacket</code> for following decoding.</p>
  <p>Here is my problem: when I try to new &amp; free an <code>AVPacket</code>, memory leaks always happen.</p>
  <p>I am just doing a simple testing:</p>
  <pre><code>for(;;) {
      AVPacket pkt;
      av_new_packet(&amp;pkt, 1000);
      av_init_packet(&amp;pkt);
      av_free_packet(&amp;pkt);
  }
  </code></pre>
  <p>What am I doing wrong?</p>