Commit 668643b9 authored by Anton Khirnov's avatar Anton Khirnov

matroskadec: check av_strdup() when setting defaults

parent 58894ab3
......@@ -851,7 +851,13 @@ static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
break;
case EBML_STR:
case EBML_UTF8:
*(char **)((char *)data+syntax[i].data_offset) = av_strdup(syntax[i].def.s);
// the default may be NULL
if (syntax[i].def.s) {
uint8_t **dst = (uint8_t**)((uint8_t*)data + syntax[i].data_offset);
*dst = av_strdup(syntax[i].def.s);
if (!*dst)
return AVERROR(ENOMEM);
}
break;
}
......
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