* qatar/master: avfiltergraph: check for sws opts being non-NULL before using them. Conflicts: libavfilter/avfiltergraph.c libavfilter/graphparser.c
Showing the changes to libavfilter/avfiltergraph.c (1 of 2 files). Show all
Unified · Split
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | 24 | ||
| 25 | #include "libavutil/avassert.h" | 25 | #include "libavutil/avassert.h" |
| 26 | #include "libavutil/avstring.h" | ||
| 26 | #include "libavutil/bprint.h" | 27 | #include "libavutil/bprint.h" |
| 27 | #include "libavutil/channel_layout.h" | 28 | #include "libavutil/channel_layout.h" |
| 28 | #include "libavutil/opt.h" | 29 | #include "libavutil/opt.h" |
| @@ -340,11 +341,11 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 311 unmodified lines | |||
| 340 | 341 | ||
| 341 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", | 342 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", |
| 342 | scaler_count++); | 343 | scaler_count++); |
| 343 | if (graph->scale_sws_opts) | 344 | av_strlcpy(scale_args, "0:0", sizeof(scale_args)); |
| 344 | snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); | 345 | if (graph->scale_sws_opts) { |
| 345 | else | 346 | av_strlcat(scale_args, ":", sizeof(scale_args)); |
| 346 | snprintf(scale_args, sizeof(scale_args), "0:0"); | 347 | av_strlcat(scale_args, graph->scale_sws_opts, sizeof(scale_args)); |
| 347 | 348 | } | |
| 348 | if ((ret = avfilter_graph_create_filter(&convert, filter, | 349 | if ((ret = avfilter_graph_create_filter(&convert, filter, |
| 349 | inst_name, scale_args, NULL, | 350 | inst_name, scale_args, NULL, |
| 350 | graph)) < 0) | 351 | graph)) < 0) |