diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-03 12:10:50 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-09-07 10:18:59 +0200 |
commit | aade60ab165716523788cd11caf03ae61b40144a (patch) | |
tree | c83e4db43e22fc12bce404bd1937238a6fe001c0 | |
parent | 3d91117df0034ca9458e4b791a182082a50a6ad9 (diff) | |
download | ffmpeg-aade60ab165716523788cd11caf03ae61b40144a.tar.gz |
matroskadec: Check that .lang was allocated and set before reading it
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5bcd3ae5b167fb74215520b01d5d810e0c8986ab)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavformat/matroskadec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 147c24cf86..fe4d932cf2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1157,7 +1157,8 @@ static void matroska_convert_tag(AVFormatContext *s, EbmlList *list, int i; for (i=0; i < list->nb_elem; i++) { - const char *lang = strcmp(tags[i].lang, "und") ? tags[i].lang : NULL; + const char *lang = tags[i].lang && strcmp(tags[i].lang, "und") ? + tags[i].lang : NULL; if (!tags[i].name) { av_log(s, AV_LOG_WARNING, "Skipping invalid tag with no TagName.\n"); |