[FFmpeg-cvslog] avutil/tests/opt: Check av_set_options_string() for failure
Michael Niedermayer
git at videolan.org
Fri Jun 14 22:20:26 EEST 2024
ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon May 20 22:52:38 2024 +0200| [d180fa89cb8e10db76e16a2844d77c914ff25179] | committer: Michael Niedermayer
avutil/tests/opt: Check av_set_options_string() for failure
This is test code after all so it should test things
Fixes: CID1518990 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e3481730ed9b3b781a0d85370826bcc57d601958)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d180fa89cb8e10db76e16a2844d77c914ff25179
---
libavutil/tests/opt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
index 3134ffd354..cdbe66e336 100644
--- a/libavutil/tests/opt.c
+++ b/libavutil/tests/opt.c
@@ -216,6 +216,7 @@ int main(void)
{
TestContext test_ctx = { 0 };
char *buf;
+ int ret;
test_ctx.class = &test_class;
av_log_set_level(AV_LOG_QUIET);
@@ -226,8 +227,10 @@ int main(void)
av_opt_free(&test_ctx);
memset(&test_ctx, 0, sizeof(test_ctx));
test_ctx.class = &test_class;
- av_set_options_string(&test_ctx, buf, "=", ",");
+ ret = av_set_options_string(&test_ctx, buf, "=", ",");
av_free(buf);
+ if (ret < 0)
+ printf("Error ret '%d'\n", ret);
if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
printf("%s\n", buf);
av_free(buf);
More information about the ffmpeg-cvslog
mailing list