Commit 670251de authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Paul B Mahol

avfilter/vf_stack: Don't modify const strings

b3b7ba62 introduced undefined behaviour: A (non-modifiable) string
literal has been assigned to a modifiable string; said string was indeed
modified later via av_strtok.
This of course caused compiler warnings because of the discarded
qualifier; these are in particular fixed by this commit.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 8ef163ba
...@@ -84,9 +84,11 @@ static av_cold int init(AVFilterContext *ctx) ...@@ -84,9 +84,11 @@ static av_cold int init(AVFilterContext *ctx)
if (!strcmp(ctx->filter->name, "xstack")) { if (!strcmp(ctx->filter->name, "xstack")) {
if (!s->layout) { if (!s->layout) {
if (s->nb_inputs == 2) if (s->nb_inputs == 2) {
s->layout = "0_0|w0_0"; s->layout = av_strdup("0_0|w0_0");
else { if (!s->layout)
return AVERROR(ENOMEM);
} else {
av_log(ctx, AV_LOG_ERROR, "No layout specified.\n"); av_log(ctx, AV_LOG_ERROR, "No layout specified.\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment