From 84bd2b4bf5ca544e29c48634ac8b2899c58b0d9d Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Sat, 18 Jun 2011 17:26:40 +0200
Subject: [PATCH] lavf: add a forgotten NULL check in
 convert_format_parameters().

---
 libavformat/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index e3485e6ffa3..81bc9b70c38 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -395,6 +395,9 @@ static AVDictionary *convert_format_parameters(AVFormatParameters *ap)
     char buf[1024];
     AVDictionary *opts = NULL;
 
+    if (!ap)
+        return NULL;
+
     if (ap->time_base.num) {
         snprintf(buf, sizeof(buf), "%d/%d", ap->time_base.den, ap->time_base.num);
         av_dict_set(&opts, "framerate", buf, 0);
-- 
GitLab