ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Thu 
May 20 21:16:52 2021 +0200| [f8611ae1efc47fbe1aff140c89bee4fd1d62d3e1] | 
committer: Michael Niedermayer

avformat/avio: Check av_opt_copy() for failure

Fixes: CID1477416 Unchecked return value

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8611ae1efc47fbe1aff140c89bee4fd1d62d3e1
---

 libavformat/avio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index ab3079116e..4846bbd8c6 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -313,8 +313,11 @@ int ffurl_open_whitelist(URLContext **puc, const char 
*filename, int flags,
     int ret = ffurl_alloc(puc, filename, flags, int_cb);
     if (ret < 0)
         return ret;
-    if (parent)
-        av_opt_copy(*puc, parent);
+    if (parent) {
+        ret = av_opt_copy(*puc, parent);
+        if (ret < 0)
+            goto fail;
+    }
     if (options &&
         (ret = av_opt_set_dict(*puc, options)) < 0)
         goto fail;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to