Commit 3514a4ce authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

memstream: handle empty stream corner case

parent 34567da2
......@@ -105,7 +105,9 @@ int vlc_memstream_vprintf(struct vlc_memstream *ms, const char *fmt,
int vlc_memstream_open(struct vlc_memstream *ms)
{
ms->error = 0;
ms->ptr = NULL;
ms->ptr = calloc(1, 1);
if (unlikely(ms->ptr == NULL))
ms->error = EOF;
ms->length = 0;
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment