Do not segfault when writing tracks such as tmcd by writing them down
as generic DataHandlers if not known.
---
 libavformat/movenc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 0f21ae2..39b381a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1258,6 +1258,18 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack 
*track)
         } else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) {
             hdlr_type = "hint";
             descr     = "HintHandler";
+        } else if (track->enc->codec_tag == MKTAG('t','m','c','d')) {
+            hdlr_type = "tmcd";
+            descr = "TimeCodeHandler";
+        } else {
+            char tag_buf[32];
+            av_get_codec_tag_string(tag_buf, sizeof(tag_buf),
+                                    track->enc->codec_tag);
+
+            av_log(track->enc, AV_LOG_WARNING,
+                   "Unknown hldr_type for %s / 0x%04X, writing dummy values\n",
+                   tag_buf, track->enc->codec_tag);
+            return 0;
         }
     }
 
-- 
1.8.3.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to