]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/avfiltergraph: Add assert to write down in machine readable form what is...
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 21 Jan 2017 00:35:52 +0000 (01:35 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 21 Jan 2017 00:35:52 +0000 (01:35 +0100)
Fixes CID1397292

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/avfiltergraph.c

index 97f242ebecceee060e4d3963a690d68c77e26f8f..534c6701a843b6d8b392f43848ddca177ca239d9 100644 (file)
@@ -876,6 +876,8 @@ static void swap_samplerates_on_filter(AVFilterContext *filter)
         for (j = 0; j < outlink->in_samplerates->nb_formats; j++) {
             int diff = abs(sample_rate - outlink->in_samplerates->formats[j]);
 
+            av_assert0(diff < INT_MAX); // This would lead to the use of uninitialized best_diff but is only possible with invalid sample rates
+
             if (diff < best_diff) {
                 best_diff = diff;
                 best_idx  = j;