aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-05-06 12:24:17 -0300
committerJames Almer <jamrial@gmail.com>2024-05-07 20:11:42 -0300
commit9614efc2586edb82cec847598c5abca0ce79dd25 (patch)
treed707ca937031fdf2b00c67edea6dc36795a9df81
parent2987c65caabceab2eaf09185392f0d07027e788f (diff)
downloadffmpeg-9614efc2586edb82cec847598c5abca0ce79dd25.tar.gz
avutil/opt: don't set a channel layout if the option is flagged as read only
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavutil/opt.c2
1 files changed, 2 insertions, 0 deletions
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);