<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, 24 Mar 2016 at 22:41 Gonzalo <<a href="mailto:ggarra13@gmail.com">ggarra13@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div>El 24/03/16 a las 03:03, Yu Ang Tan
escribió:<br>
</div></div><div bgcolor="#FFFFFF" text="#000000">
<blockquote type="cite">
<div dir="ltr"><br>
<div>
<div>// allocate context</div>
<div>pFormatCtx = avformat_alloc_context();</div>
<div>pFormatCtx->oformat = pOutFormat;</div>
<div>memcpy(pFormatCtx->filename,filename,</div>
<div><span style="white-space:pre-wrap"> </span>min(strlen(filename),
sizeof(pFormatCtx->filename)));</div>
</div>
</div>
</blockquote></div><div bgcolor="#FFFFFF" text="#000000">
Here you are trashing memory. You need to allocate
pFormatCtx->filename (or use something like strdup).<br>
<br>
<br>
<pre cols="72">--
Gonzalo Garramuño
<a href="mailto:ggarra13@gmail.com" target="_blank">ggarra13@gmail.com</a>
</pre>
</div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a></blockquote><div><br></div>Hi Gonzalo<div><br></div><div>I don't think that's the case. AVFormatContext::filename is of type char[1024] not char*. Therefore I cannot assign to it. </div></div></div>