From 1c2e07b8111b24f62b8d1bda62907848e34dfbcb Mon Sep 17 00:00:00 2001
From: Alex Converse <alex.converse@gmail.com>
Date: Wed, 21 Sep 2011 15:26:35 -0700
Subject: [PATCH] mp4: Don't read an empty Decoder Config Descriptor

---
 libavformat/isom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 48fd8e14524..896730c5a61 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -418,7 +418,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
     len = ff_mp4_read_descr(fc, pb, &tag);
     if (tag == MP4DecSpecificDescrTag) {
         av_dlog(fc, "Specific MPEG4 header len=%d\n", len);
-        if((uint64_t)len > (1<<30))
+        if (!len || (uint64_t)len > (1<<30))
             return -1;
         av_free(st->codec->extradata);
         st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
-- 
GitLab