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.
Unified · Split
| @@ -84,9 +84,11 @@ static av_cold int init(AVFilterContext *ctx) · 83 unmodified lines | ||
| 84 | 84 | |
| 85 | 85 | if (!strcmp(ctx->filter->name, "xstack")) { |
| 86 | 86 | if (!s->layout) { |
| 87 | − if (s->nb_inputs == 2) | |
| 88 | − s->layout = "0_0|w0_0"; | |
| 89 | − else { | |
| 87 | + if (s->nb_inputs == 2) { | |
| 88 | + s->layout = av_strdup("0_0|w0_0"); | |
| 89 | + if (!s->layout) | |
| 90 | + return AVERROR(ENOMEM); | |
| 91 | + } else { | |
| 90 | 92 | av_log(ctx, AV_LOG_ERROR, "No layout specified.\n"); |
| 91 | 93 | return AVERROR(EINVAL); |
| 92 | 94 | } |