diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-05-20 21:16:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:20 +0200 |
commit | 4588d46c378303445f86973beff00e555f69ecca (patch) | |
tree | 124c7eb686a1fc58c16d0d2c2928e59eea55215b | |
parent | 9c858980560dbab441b12c91287798d40a8e3bae (diff) | |
download | ffmpeg-4588d46c378303445f86973beff00e555f69ecca.tar.gz |
avformat/avio: Check av_opt_copy() for failure
Fixes: CID1477416 Unchecked return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f8611ae1efc47fbe1aff140c89bee4fd1d62d3e1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/avio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 3606eb0fda..9cb9b5aa69 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; |