]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfiltergraph.c
lavfi: deprecate AVFilterGraph->resample_lavr_opts
[ffmpeg] / libavfilter / avfiltergraph.c
index 97f242ebecceee060e4d3963a690d68c77e26f8f..75bd516896842a014df4fb5d4e3d52e6bff5a091 100644 (file)
@@ -128,7 +128,9 @@ void avfilter_graph_free(AVFilterGraph **graph)
 
     av_freep(&(*graph)->scale_sws_opts);
     av_freep(&(*graph)->aresample_swr_opts);
+#if FF_API_LAVR_OPTS
     av_freep(&(*graph)->resample_lavr_opts);
+#endif
     av_freep(&(*graph)->filters);
     av_freep(&(*graph)->internal);
     av_freep(graph);
@@ -876,6 +878,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;