[FFmpeg-cvslog] avformat/avio: Check av_opt_copy() for failure
Michael Niedermayer
git at videolan.org
Fri Jun 18 22:14:24 EEST 2021
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Thu May 20 21:16:52 2021 +0200| [5d3c96cf11768a127857161e2504c9f60ef4f97d] | committer: Michael Niedermayer
avformat/avio: Check av_opt_copy() for failure
Fixes: CID1477416 Unchecked return value
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit f8611ae1efc47fbe1aff140c89bee4fd1d62d3e1)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d3c96cf11768a127857161e2504c9f60ef4f97d
---
libavformat/avio.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 8011482e76..cd9b5d9e7f 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -316,8 +316,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;
More information about the ffmpeg-cvslog
mailing list