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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_stack.c+5−3
@@ -84,9 +84,11 @@ static av_cold int init(AVFilterContext *ctx) · 83 unmodified lines
8484
8585 if (!strcmp(ctx->filter->name, "xstack")) {
8686 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 {
9092 av_log(ctx, AV_LOG_ERROR, "No layout specified.\n");
9193 return AVERROR(EINVAL);
9294 }

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