A new buffer created every time the program is called
<p>I need to create a new buffer every time.
Something like this</p>

<pre><code>int bufcalc;

bufcalc++;

BufferSptr buf[bufcalc] (new Buffer (pMediaData-&gt;Size()) );
memcpy(buf[bufcalc]-&gt;GetData() ,pMediaData-&gt;GetData() , pMediaData-&gt;Size());
</code></pre>

<p>where bufcalc is type int and increments everytime.</p>

<pre><code>   if(bufcalc&gt;=2)
{
    DecodeBufferData ( buf[bufcalc-1], decodeInfo );
}
</code></pre>

<p>i get the following error:</p>

<p>variable-sized object 'buf' may not be initialized</p>
