The warning silenced was: libavfilter/avfiltergraph.c: In function ‘avfilter_graph_config’: libavfilter/avfiltergraph.c:500:13: warning: ‘best_idx’ may be used uninitialized in this function [-Wuninitialized]
Showing the changes to libavfilter/avfiltergraph.c (1 of 1 file). Show all
Unified · Split
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "internal.h" |
| 30 | 30 | |
| 31 | 31 | #include "libavutil/audioconvert.h" |
| 32 | +#include "libavutil/avassert.h" | |
| 32 | 33 | #include "libavutil/log.h" |
| 33 | 34 | |
| 34 | 35 | static const AVClass filtergraph_class = { |
| @@ -497,7 +498,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 462 unmodified lines | ||
| 497 | 498 | |
| 498 | 499 | for (i = 0; i < filter->nb_outputs; i++) { |
| 499 | 500 | AVFilterLink *outlink = filter->outputs[i]; |
| 500 | − int best_idx, best_score = INT_MIN; | |
| 501 | + int best_idx = -1, best_score = INT_MIN; | |
| 501 | 502 | |
| 502 | 503 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 503 | 504 | outlink->in_formats->format_count < 2) |
| @@ -530,6 +531,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 26 unmodified lines | ||
| 530 | 531 | best_idx = j; |
| 531 | 532 | } |
| 532 | 533 | } |
| 534 | + av_assert0(best_idx >= 0); | |
| 533 | 535 | FFSWAP(int, outlink->in_formats->formats[0], |
| 534 | 536 | outlink->in_formats->formats[best_idx]); |
| 535 | 537 | } |