From a76e91bf6708f8a4d17a69b157c4a860ccdcda95 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 18 Feb 2015 11:55:44 +0100 Subject: avfilter/avfiltergraph: assert that the heap_bubble index is valid This might help coverity Signed-off-by: Michael Niedermayer --- libavfilter/avfiltergraph.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavfilter') diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index a859ecbde9..2e69cdd2d7 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -1280,6 +1280,8 @@ static void heap_bubble_up(AVFilterGraph *graph, { AVFilterLink **links = graph->sink_links; + av_assert0(index >= 0); + while (index) { int parent = (index - 1) >> 1; if (links[parent]->current_pts >= link->current_pts) @@ -1297,6 +1299,8 @@ static void heap_bubble_down(AVFilterGraph *graph, { AVFilterLink **links = graph->sink_links; + av_assert0(index >= 0); + while (1) { int child = 2 * index + 1; if (child >= graph->sink_links_count) -- cgit v1.2.3