diff mbox series

[FFmpeg-devel,3/3] avutil/opt: propagate av_dict_copy() errors in av_opt_{get, set}_dict_val()

Message ID 20240506152704.1596-3-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avutil/opt: add a note about the av_opt_set_chlayout() behavior | expand

Checks

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

Commit Message

James Almer May 6, 2024, 3:27 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/opt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 60b0c2a946..23bc8c887c 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -934,9 +934,8 @@  int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val,
 
     dst = (AVDictionary **)(((uint8_t *)target_obj) + o->offset);
     av_dict_free(dst);
-    av_dict_copy(dst, val, 0);
 
-    return 0;
+    return av_dict_copy(dst, val, 0);
 }
 
 int av_opt_set_chlayout(void *obj, const char *name,
@@ -1348,9 +1347,8 @@  int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDiction
         return AVERROR(EINVAL);
 
     src = *(AVDictionary **)(((uint8_t *)target_obj) + o->offset);
-    av_dict_copy(out_val, src, 0);
 
-    return 0;
+    return av_dict_copy(out_val, src, 0);;
 }
 
 int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)