hls: Check av_opt_set_dict return value as well
authorLuca Barbato <lu_zero@gentoo.org>
Wed, 30 Sep 2015 23:34:35 +0000 (01:34 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 1 Oct 2015 11:51:13 +0000 (13:51 +0200)
Bug-Id: CID 1320426

libavformat/hls.c

index 467a491..be47207 100644 (file)
@@ -220,9 +220,8 @@ static int url_connect(struct variant *var, AVDictionary *opts)
 
     av_dict_copy(&tmp, opts, 0);
 
-    av_opt_set_dict(var->input, &tmp);
-
-    if ((ret = ffurl_connect(var->input, NULL)) < 0) {
+    if ((ret = av_opt_set_dict(var->input, &tmp)) < 0 ||
+        (ret = ffurl_connect(var->input, NULL)) < 0) {
         ffurl_close(var->input);
         var->input = NULL;
     }