aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-06-25 13:01:31 +0200
committerAnton Khirnov <anton@khirnov.net>2012-06-26 19:10:17 +0200
commit61d158c321a82ec7bfc46ce480997797e8048b85 (patch)
treeaea73a0d6a327e8032daf4d21a4fd4d665bca7b1
parentfd2784c3b5e5ea13dd308b1eeeef0dd3c22a3d4a (diff)
downloadffmpeg-61d158c321a82ec7bfc46ce480997797e8048b85.tar.gz
avfiltergraph: shut up uninitialized variable warning.
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]
-rw-r--r--libavfilter/avfiltergraph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index b9f01645d0..c147c3b781 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -29,6 +29,7 @@
#include "internal.h"
#include "libavutil/audioconvert.h"
+#include "libavutil/avassert.h"
#include "libavutil/log.h"
static const AVClass filtergraph_class = {
@@ -497,7 +498,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter)
for (i = 0; i < filter->nb_outputs; i++) {
AVFilterLink *outlink = filter->outputs[i];
- int best_idx, best_score = INT_MIN;
+ int best_idx = -1, best_score = INT_MIN;
if (outlink->type != AVMEDIA_TYPE_AUDIO ||
outlink->in_formats->format_count < 2)
@@ -530,6 +531,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter)
best_idx = j;
}
}
+ av_assert0(best_idx >= 0);
FFSWAP(int, outlink->in_formats->formats[0],
outlink->in_formats->formats[best_idx]);
}