diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index a1b7f56..292bd29 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -920,7 +920,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; } |