[FFmpeg-cvslog] matroskadec: Check that .lang was allocated and set before reading it

Martin Storsjö git at videolan.org
Thu Sep 26 00:26:09 CEST 2013


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Tue Sep  3 12:10:50 2013 +0300| [068c8672866858d56ea8747fca5f1e0fcd2d920c] | committer: Sean McGovern

matroskadec: Check that .lang was allocated and set before reading it

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 5bcd3ae5b167fb74215520b01d5d810e0c8986ab)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=068c8672866858d56ea8747fca5f1e0fcd2d920c
---

 libavformat/matroskadec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 891eb83..03839f8 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1079,7 +1079,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");



More information about the ffmpeg-cvslog mailing list