Browse Source

avfilter/avfiltergraph: assert that the heap_bubble index is valid

This might help coverity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
a76e91bf67
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavfilter/avfiltergraph.c

+ 4
- 0
libavfilter/avfiltergraph.c View File

@@ -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)


Loading…
Cancel
Save