diff mbox series

[FFmpeg-devel,3/3] avformat/avio: Check av_opt_copy() for failure

Message ID 20210520212549.15466-3-michael@niedermayer.cc
State Accepted
Commit f8611ae1efc47fbe1aff140c89bee4fd1d62d3e1
Headers show
Series [FFmpeg-devel,1/3] avformat/moflex: Initialize format | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer May 20, 2021, 9:25 p.m. UTC
Fixes: CID1477416 Unchecked return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/avio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer May 27, 2021, 3:39 p.m. UTC | #1
On Thu, May 20, 2021 at 11:25:49PM +0200, Michael Niedermayer wrote:
> Fixes: CID1477416 Unchecked return value
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/avio.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 2974f4b2b4..6be6f9bf97 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;