Skip to content

Commit

Permalink
lavfi/avfiltergraph: check pick_format return code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas George committed Jan 2, 2013
1 parent 82deb0c commit b99bef1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libavfilter/avfiltergraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,23 +795,26 @@ static int pick_formats(AVFilterGraph *graph)
if (filter->nb_inputs){
for (j = 0; j < filter->nb_inputs; j++){
if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->format_count == 1) {
pick_format(filter->inputs[j], NULL);
if ((ret = pick_format(filter->inputs[j], NULL)) < 0)
return ret;
change = 1;
}
}
}
if (filter->nb_outputs){
for (j = 0; j < filter->nb_outputs; j++){
if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->format_count == 1) {
pick_format(filter->outputs[j], NULL);
if ((ret = pick_format(filter->outputs[j], NULL)) < 0)
return ret;
change = 1;
}
}
}
if (filter->nb_inputs && filter->nb_outputs && filter->inputs[0]->format>=0) {
for (j = 0; j < filter->nb_outputs; j++) {
if(filter->outputs[j]->format<0) {
pick_format(filter->outputs[j], filter->inputs[0]);
if ((ret = pick_format(filter->outputs[j], filter->inputs[0])) < 0)
return ret;
change = 1;
}
}
Expand Down

0 comments on commit b99bef1

Please sign in to comment.