[FFmpeg-cvslog] avutil/opt: don't set a channel layout if the option is flagged as read only

James Almer git at videolan.org
Wed May 8 02:12:29 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon May  6 12:24:17 2024 -0300| [9614efc2586edb82cec847598c5abca0ce79dd25] | committer: James Almer

avutil/opt: don't set a channel layout if the option is flagged as read only

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9614efc2586edb82cec847598c5abca0ce79dd25
---

 libavutil/opt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index a892e056cb..60b0c2a946 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -949,6 +949,8 @@ int av_opt_set_chlayout(void *obj, const char *name,
 
     if (!o || !target_obj)
         return AVERROR_OPTION_NOT_FOUND;
+    if (o->flags & AV_OPT_FLAG_READONLY)
+        return AVERROR(EINVAL);
 
     dst = (AVChannelLayout*)((uint8_t*)target_obj + o->offset);
 



More information about the ffmpeg-cvslog mailing list