Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-05-14 07:15:17 +0300
committerPaul B Mahol <onemda@gmail.com>2019-05-14 15:47:51 +0300
commit670251de56cdcda0c32d588959c8ed2da09075a2 (patch)
tree8590795298401f1ac80c04ce00ca4518318ce0b5 /libavfilter/vf_stack.c
parent8ef163ba9e3d2d7cb31856c33f86439e234fe623 (diff)
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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter/vf_stack.c')
-rw-r--r--libavfilter/vf_stack.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c
index 1455f196a7..4d254e0013 100644
--- a/libavfilter/vf_stack.c
+++ b/libavfilter/vf_stack.c
@@ -84,9 +84,11 @@ static av_cold int init(AVFilterContext *ctx)
if (!strcmp(ctx->filter->name, "xstack")) {
if (!s->layout) {
- if (s->nb_inputs == 2)
- s->layout = "0_0|w0_0";
- else {
+ if (s->nb_inputs == 2) {
+ s->layout = av_strdup("0_0|w0_0");
+ if (!s->layout)
+ return AVERROR(ENOMEM);
+ } else {
av_log(ctx, AV_LOG_ERROR, "No layout specified.\n");
return AVERROR(EINVAL);
}