avfilter/avfiltergraph: assert that the heap_bubble index is valid
This might help coverity Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
424ed1a83e
commit
a76e91bf67
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue