[FFmpeg-devel] [PATCH] matroskadec: skip invalid tags with no TagName

Anton Khirnov anton
Sat Oct 30 09:54:39 CEST 2010


fixes segfault in issue 2328
---
 libavformat/matroskadec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 136839a..b712415 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1033,6 +1033,11 @@ static void matroska_convert_tag(AVFormatContext *s, EbmlList *list,
 
     for (i=0; i < list->nb_elem; i++) {
         const char *lang = strcmp(tags[i].lang, "und") ? tags[i].lang : NULL;
+
+        if (!tags[i].name) {
+            av_log(s, AV_LOG_WARNING, "Skipping tag with no TagName.\n");
+            continue;
+        }
         if (prefix)  snprintf(key, sizeof(key), "%s/%s", prefix, tags[i].name);
         else         av_strlcpy(key, tags[i].name, sizeof(key));
         if (tags[i].def || !lang) {
-- 
1.7.1




More information about the ffmpeg-devel mailing list