<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">El 24/03/16 a las 03:03, Yu Ang Tan
escribió:<br>
</div>
<blockquote
cite="mid:CAG4+fe56mg7FaPssSingCZmUy0fG5RXTt+e8NRqaQdDB8pzaww@mail.gmail.com"
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 class="Apple-tab-span" style="white-space:pre"> </span>min(strlen(filename),
sizeof(pFormatCtx->filename)));</div>
</div>
</div>
</blockquote>
Here you are trashing memory. You need to allocate
pFormatCtx->filename (or use something like strdup).<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Gonzalo Garramuño
<a class="moz-txt-link-abbreviated" href="mailto:ggarra13@gmail.com">ggarra13@gmail.com</a>
</pre>
</body>
</html>