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@niedermayer.cc>
(cherry picked from commit e3481730ed)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -216,6 +216,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
TestContext test_ctx = { 0 };
|
TestContext test_ctx = { 0 };
|
||||||
char *buf;
|
char *buf;
|
||||||
|
int ret;
|
||||||
test_ctx.class = &test_class;
|
test_ctx.class = &test_class;
|
||||||
|
|
||||||
av_log_set_level(AV_LOG_QUIET);
|
av_log_set_level(AV_LOG_QUIET);
|
||||||
@@ -226,8 +227,10 @@ int main(void)
|
|||||||
av_opt_free(&test_ctx);
|
av_opt_free(&test_ctx);
|
||||||
memset(&test_ctx, 0, sizeof(test_ctx));
|
memset(&test_ctx, 0, sizeof(test_ctx));
|
||||||
test_ctx.class = &test_class;
|
test_ctx.class = &test_class;
|
||||||
av_set_options_string(&test_ctx, buf, "=", ",");
|
ret = av_set_options_string(&test_ctx, buf, "=", ",");
|
||||||
av_free(buf);
|
av_free(buf);
|
||||||
|
if (ret < 0)
|
||||||
|
printf("Error ret '%d'\n", ret);
|
||||||
if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
|
if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
|
||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
av_free(buf);
|
av_free(buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user