diff mbox series

[FFmpeg-devel,3/7] avutil/tests/opt: Check av_set_options_string() for failure

Message ID 20240521024652.1006233-3-michael@niedermayer.cc
State Accepted
Commit e3481730ed9b3b781a0d85370826bcc57d601958
Headers show
Series [FFmpeg-devel,1/7] avutil/random_seed: Avoid dead returns | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer May 21, 2024, 2:46 a.m. UTC
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@niedermayer.cc>
---
 libavutil/tests/opt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
index d189938d9ba..02b3ed6e90e 100644
--- a/libavutil/tests/opt.c
+++ b/libavutil/tests/opt.c
@@ -304,6 +304,7 @@  int main(void)
     {
         TestContext test_ctx = { 0 };
         char *buf;
+        int ret;
         test_ctx.class = &test_class;
 
         av_log_set_level(AV_LOG_QUIET);
@@ -314,8 +315,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) {
                 ChildContext child_ctx = { 0 };
                 printf("%s\n", buf);