summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-25 09:38:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-25 09:39:24 +0200
commit57070d9892adf55b9fa475f377352b2d42e095a6 (patch)
tree21b5d6751ea0b95165de65d09e2815ab776bbccd /libavformat
parent65bf9a44d7b0295e03463fd143499ab5b85d0cb7 (diff)
parent668643b9239c70b777aea322eab411ebc960d9a0 (diff)
downloadffmpeg-streaming-57070d9892adf55b9fa475f377352b2d42e095a6.zip
ffmpeg-streaming-57070d9892adf55b9fa475f377352b2d42e095a6.tar.gz
Merge commit '668643b9239c70b777aea322eab411ebc960d9a0'
* commit '668643b9239c70b777aea322eab411ebc960d9a0': matroskadec: check av_strdup() when setting defaults Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c8
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;
}
OpenPOWER on IntegriCloud