Commit 0ef5fc48 authored by Julian Rother's avatar Julian Rother

transcode: Fixed segfault in filter list parsing

parent 8bb612c8
......@@ -82,7 +82,7 @@ static void setup_input_stream(char *stream, AVFormatContext *demux,
for (p = jenter(jlookup(stream, "filters")); p; p = jnext(p))
{
(*pads)->name = av_strdup("in");
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, 0), 0, pads, 0)) < 0)
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, "ERROR"), 0, pads, 0)) < 0)
job_failed("Parsing filter string \"%s\" failed: %s", jstr(p, 0), av_err2str(err));
if ((*pads)->next)
job_failed("Unconnected filter pad\n");
......@@ -137,7 +137,7 @@ static void prepare_output_stream(char *stream, AVStream *st,
for (p = jenter(jlookup(stream, "filters")); p; p = jnext(p))
{
(*pads)->name = av_strdup("out");
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, 0), pads, 0, 0)) < 0)
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, "ERROR"), pads, 0, 0)) < 0)
job_failed("Parsing filter string \"%s\" failed: %s", jstr(p, 0), av_err2str(err));
if ((*pads)->next)
job_failed("Unconnected filter pad\n");
......@@ -283,7 +283,7 @@ int main(int argc, char *argv[])
/* TODO: Connect pads of same name before applying any filter strings */
for (p = jenter(jlookup(argv[4], "filters")); p; p = jnext(p))
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, 0), &outpads, &inpads, 0)) < 0)
if ((err = avfilter_graph_parse_ptr(fg, jstr(p, "ERROR"), &outpads, &inpads, 0)) < 0)
job_failed("Parsing filter string \"%s\" failed: %s", jstr(p, 0), av_err2str(err));
if (avfilter_graph_config(fg, 0) < 0)
job_failed("Error configuring filter graph: %s", av_err2str(err));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment