History

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.

Andreas Rheinhardt committed 7 years ago

Commit 670251d1 parent 8ef163b1 file · +5 −3Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t