diff mbox series

[FFmpeg-devel,11/38] lavu/opt: simplify error handling in get_number()

Message ID 20240223143115.16521-12-anton@khirnov.net
State Accepted
Commit 1ffa657a0347b7f84dd737b8c91890ad26ac54f5
Headers show
Series [FFmpeg-devel,01/38] lavu/opt: cosmetics, change option flags to (1 << N) style | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Feb. 23, 2024, 1:58 p.m. UTC
---
 libavutil/opt.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 54a99c689c..75a27c4d9b 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -961,16 +961,11 @@  static int get_number(void *obj, const char *name, double *num, int *den, int64_
     void *dst, *target_obj;
     const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
     if (!o || !target_obj)
-        goto error;
+        return AVERROR_OPTION_NOT_FOUND;
 
     dst = ((uint8_t *)target_obj) + o->offset;
 
     return read_number(o, dst, num, den, intnum);
-
-error:
-    *den    =
-    *intnum = 0;
-    return -1;
 }
 
 int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)