1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '668643b9239c70b777aea322eab411ebc960d9a0'

* commit '668643b9239c70b777aea322eab411ebc960d9a0':
  matroskadec: check av_strdup() when setting defaults

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-25 09:38:33 +02:00
commit 57070d9892

View File

@ -920,7 +920,13 @@ static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
break; break;
case EBML_STR: case EBML_STR:
case EBML_UTF8: 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; break;
} }